Barcode Label Configuration
Posted by Mont Rothstein on 27 September 2018 12:45 PM

Overview

The labels that can be printed for property are configurable. The can include barcodes, data from Adams, and even images. The formatting is specified using Zebra ZPL2 commands. Data from Adams is specified using Field Paths.

Formatting - ZPL2

References

ZPL2 Programming Guide Vol 1

ZPL2 Programming Guide Vol 2

Tools

Online Viewer to test ZPL2 commands

Simple Commands

These are some simple commands used in the default label configuration.

^A = Font. Values: font name (no comma) field orientation, character height, width
Font size calculation from points (ex: 12/14/24/36/48 pt font) (points x 203.2) / 72 --- This is for a 203.2 DPI printer
Scalable font (^A0) looks best when width and height are the same points

^BC = Code 128 Bar Code. Values: orientation, height, print interpretation line (Y or N), print interpretation line above code (Y or N), UCC check digit (Y or N), mode

^FD = Field Data. Values: data

^FO = Field Origin. Values: X-axis location, Y-axis location, justification (0 = left, 1 = right, 2 = auto)

^FS = Field Separator. Follows the data for a ^FD

^GB = Graphic Box. Values: width, height, border thickness, color (B = Black, W = White), degree of cornerrounding (0-8)

^GF = Graphic Field. Values: compression type (Ascii (A), Binary (B), Compressed Binary (C), binary byte count, graphic field count, bytes per row, data

^PW = Print Width. Values: label width (ex: 4" @ 203 dpi = 812)

^TB = Text Blocks. Values: block rotation, width, height. The data in the following FD are written with line wrapping into this box. Anything that doesn't fit is truncated.

^XA = Start Format

^XZ = End Format

Adams Data - Field Paths

A field path specifies the specific piece of data that will be included on the label.  Field paths start from the property item and consist of a dot separated path up to and including the field whose value will be included on the label. This can be a field on the property item itself or on a related item such as the Submission or Folder (case).
 
They take the format of <FIELDPATH> on the label. Where FIELDPATH is replaced with the actual path.
 
Ex 1: <UniqueId> - This is the barcode ID
Ex 2: <PropertyGroup.ContributingAgencyId> - The agency that submitted the property (ex: an agency within the county)
Ex 3: <CollectedOn:g> - The date and time the property was collected. In the format 00/00/0000 at 00:00 PM
Ex 4: <Description> - The description of the piece of property
 
For more information on field paths see: Field Paths and Field Path List.

Example

Here is an example label configuration in three formats, as it would be entered into Adams (raw), commented, and with data from Adams as it would be sent to the printer.

Raw Configuration

This is the configuration as it would be entered into Adams.

^XA

^PW812

^FO20,20
^GFA,765,765,9,,:::001P02,I02001002001,M01C08,0018I07F8I02,003C003IFI07,006F83FE1FF0198,00C3IF003FFE0C,01801C07FC7C006,13R032,,:1,,08S04,,04S08,L01FFE,020400JFC,020203FE3FFI01,I010FI01FC,J01K03E,J064J0198,K08K0C,00161L061F,02002L03018,02004L01819,02P0C18,I01N0408,I03I01J0208,0402I01L0C,04K02L04,M02L04,08K02L06,08R06,0A801CN07,1A800F8I038003,1J07F001FI03,15I07FE0FEI038,17I07FFC7CI018,36I03FFC08I018,26I03FFEK018,2EI01IFK01C,0CI01IF87J0C,4CI01IF87J0C8,4CJ0IFC7J0C,5CJ0IFE3J0E,582I0JF38I06,:982I0JFB80806,B82I0KF810064,B82I0KF82006,BFE040KF8I07,FC0601KF9I07,EF3D83KFEI07,EFF81LFE0017,EFF43MF00674,EFF80LFE01C64,E7F3C1KF300844,67IFE1IF1F8006,67KF003FFC006,63QF90E,63RF0C8,21RF,31RF81,18RF8,1CRF82,0C3PFE04,061PFC08,030PF01,01C1NFC06,00E03LFE00C,007801JFC0038,001FI0FF8001E,I07F001E003F8,I01FFE001FFE,J01FFC0FFE,L03IF,M07F8,M03F,N0C,,^FS

^FO120,20,0
^A0N,102,102

^FDProperty^FS

^FO475,20,0
^BCN,80,Y,N,N,N

^FD<UniqueId>^FS

^FO20,160,0
^A0N,40,40

^FDContributing Agency: <PropertyGroup.ContributingAgencyId>^FS
^FO365,191,0
^GB415,0,2^FS

^FO20,220,0
^A0N,40,40

^FD<Folder.Name>    Item <FullItemId>^FS

^FO20,280,0
^A0N,40,40

^FDCollected On: <CollectedOn:g>^FS
^FO240,311,0
^GB540,0,2^FS

^FO20,340,0
^A0N,40,40

^FDCollected By: <CollectedBy.DisplayName>^FS
^FO240,371,0
^GB540,0,2^FS

^FO20,400,0
^A0N,40,40

^FDCategory: <Category>^FS
^FO180,431,0
^GB400,0,2^FS
^FO600,400,0
^A0N,40,40
^FDQty: <Quantity>^FS
^FO675,431,0
^GB105,0,2^FS

^FO20,460,0
^A0N,40,40

^FDDescription:^FS
^FO20,520,0
^A0N,40,40
^TBN,780,160
^FD<Description>^FS

^FO20,710,0
^A0N,40,40

^FDRecovery Location:^FS
^FO20,770,0
^A0N,40,40
^TBN,780,160
^FD<RecoveryLocation>^FS

^XZ

Commented Configuration

This is the same configuration with comments. This is not valid for entering into Adams.

^XA

// Set print area width
^PW812

// Default Agency Logo
^FO20,20
"^GFA,765,765,9,,:::001P02,I02001002001,M01C08,0018I07F8I02,003C003IFI07,006F83FE1FF0198,00C3IF003FFE0C,01801C07FC7C006,13R032,,:1,,08S04,,04S08,L01FFE,020400JFC,020203FE3FFI01,I010FI01FC,J01K03E,J064J0198,K08K0C,00161L061F,02002L03018,02004L01819,02P0C18,I01N0408,I03I01J0208,0402I01L0C,04K02L04,M02L04,08K02L06,08R06,0A801CN07,1A800F8I038003,1J07F001FI03,15I07FE0FEI038,17I07FFC7CI018,36I03FFC08I018,26I03FFEK018,2EI01IFK01C,0CI01IF87J0C,4CI01IF87J0C8,4CJ0IFC7J0C,5CJ0IFE3J0E,582I0JF38I06,:982I0JFB80806,B82I0KF810064,B82I0KF82006,BFE040KF8I07,FC0601KF9I07,EF3D83KFEI07,EFF81LFE0017,EFF43MF00674,EFF80LFE01C64,E7F3C1KF300844,67IFE1IF1F8006,67KF003FFC006,63QF90E,63RF0C8,21RF,31RF81,18RF8,1CRF82,0C3PFE04,061PFC08,030PF01,01C1NFC06,00E03LFE00C,007801JFC0038,001FI0FF8001E,I07F001E003F8,I01FFE001FFE,J01FFC0FFE,L03IF,M07F8,M03F,N0C,,^FS

// Property
^FO120,20,0
^A0N,102,102
^FDProperty^FS

// Barcode
^FO475,20,0
^BCN,80,Y,N,N,N
^FD<UniqueId>^FS

// Contributing Agency Agency
^FO20,160,0
^A0N,40,40
^FDContributing Agency: <PropertyGroup.ContributingAgencyId>^FS
^FO365,191,0
^GB415,0,2^FS

// Folder Name and Item ID
^FO20,220,0
^A0N,40,40
^FD<Folder.Name> Item <FullItemId>^FS

// Collected On
^FO20,280,0
^A0N,40,40
^FDCollected On: <CollectedOn:g>^FS
^FO240,311,0
^GB540,0,2^FS

// Collected By
^FO20,340,0
^A0N,40,40
^FDCollected By: <CollectedBy.DisplayName>^FS
^FO240,371,0
^GB540,0,2^FS

// Category and Quantity
^FO20,400,0
^A0N,40,40
^FDCategory: <Category>^FS
^FO180,431,0
^GB400,0,2^FS
^FO600,400,0
^A0N,40,40
^FDQty: <Quantity>^FS
^FO675,431,0
^GB105,0,2^FS

// Description
^FO20,460,0
^A0N,40,40
^FDDescription:^FS
^FO20,520,0
^A0N,40,40
^TBN,780,160
^FD<Description>^FS

// Recovery Location
^FO20,710,0
^A0N,40,40
^FDRecovery Location:^FS
^FO20,770,0
^A0N,40,40
^TBN,780,160
^FD<RecoveryLocation>^FS

// End Format
^XZ

Configuration with Data

This is the same configuration with sample data inserted as it would be pulled from Adams. This is what would be sent to the printer.

^XA
^PW812
^FO20,20
^GFA,765,765,9,,:::001P02,I02001002001,M01C08,0018I07F8I02,003C003IFI07,006F83FE1FF0198,00C3IF003FFE0C,01801C07FC7C006,13R032,,:1,,08S04,,04S08,L01FFE,020400JFC,020203FE3FFI01,I010FI01FC,J01K03E,J064J0198,K08K0C,00161L061F,02002L03018,02004L01819,02P0C18,I01N0408,I03I01J0208,0402I01L0C,04K02L04,M02L04,08K02L06,08R06,0A801CN07,1A800F8I038003,1J07F001FI03,15I07FE0FEI038,17I07FFC7CI018,36I03FFC08I018,26I03FFEK018,2EI01IFK01C,0CI01IF87J0C,4CI01IF87J0C8,4CJ0IFC7J0C,5CJ0IFE3J0E,582I0JF38I06,:982I0JFB80806,B82I0KF810064,B82I0KF82006,BFE040KF8I07,FC0601KF9I07,EF3D83KFEI07,EFF81LFE0017,EFF43MF00674,EFF80LFE01C64,E7F3C1KF300844,67IFE1IF1F8006,67KF003FFC006,63QF90E,63RF0C8,21RF,31RF81,18RF8,1CRF82,0C3PFE04,061PFC08,030PF01,01C1NFC06,00E03LFE00C,007801JFC0038,001FI0FF8001E,I07F001E003F8,I01FFE001FFE,J01FFC0FFE,L03IF,M07F8,M03F,N0C,,^FS

^FO120,20,0
^A0N,102,102
^FDProperty^FS
^FO475,20,0
^BCN,80,Y,N,N,N
^FDPI-00000000^FS
^FO20,160,0
^A0N,40,40
^FDSubmitting Agency: My Smalltown PD^FS
^FO340,191,0
^GB440,0,2^FS
^FO20,220,0
^A0N,40,40
^FDCase # 00-000000 Item 0-0-0-0-0-0^FS
^FO20,280,0
^A0N,40,40
^FDCollected On: 00/00/0000 at 00:00 PM^FS
^FO240,311,0
^GB540,0,2^FS
^FO20,340,0
^A0N,40,40
^FDCollected By: Sgt. John Smith^FS
^FO240,371,0
^GB540,0,2^FS
^FO20,400,0
^A0N,40,40
^FDCategory: Firearms^FS
^FO180,431,0
^GB400,0,2^FS

^FO600,400,0
^A0N,40,40
^FDQty: 000^FS
^FO675,431,0
^GB105,0,2^FS

^FO20,460,0
^A0N,40,40
^FDDescription:^FS
^FO20,520,0
^A0N,40,40
^TBN,792,160
^FDThis is a description of a property item. It is meant to fill more than a single line of text. There is a forced new line after the first sentence. This field allows for 4 lines maximum.^FS
^FO20,710,0
^A0N,40,40
^FDRecovery Location:^FS
^FO20,770,0
^A0N,40,40
^TBN,792,80
^FDThis space is for the recovery location. There are two lines allowed maximum. This would have things like bedroom 1 under the bed^FS
^XZ

 

 


Comments (0)