User Tools

Site Tools


zebra_eltron_label_creation_via_zpl

Working with Zebra ZPL II codes

Please Note:

All of the fields you are using on your labels must not contain any special characters. Some of these special characters are commas, open and closing brackets () or {} or [], greater than and less than signs <>, pipes |, colons :, semicolons ;, and single or double quotes “ or '. All these symbols mean specific things within a code based label, so having them in your part numbers, descriptions, and comment fields will cause issues with printing your code based labels.

Also note that Zebra printers that use the ZPL2 programming language use the carrot (^) symbol prefix for each line of code. This is also a special character that can not be used in any of the fields on your label.

To try and clarify why this is so important, here is an example of a ZPL II code based label for the Zebra label printers:

 ^XA 
 ^LH55,30 
 ^FO20,10^CFD,27,13^FDCompany Name^FS 
 ^FO20,60^AD^FD<DESCRIPTION >^FS 
 ^FO40,160^BY2,2.0^BCN,100,Y,N,N,N^FD<PART,-1>^FS 
 ^XZ 

This form file creates the following label:

Explanation of the code shown above:

- ^XA Indicates the start of label format.

- ^LH sets the label home position (55 dots to the right, 30 dots down from the top edge of the label).

- ^FO20,10 Sets the field origin 20 dots to the right and 10 dots down from the home position defined by the ^LH instruction.

- ^CFD Sets the height and width parameters for font type D.

- ^FD Start of Field Data.

- Company Name. Actual Field Data. Place your company name here. For this example, we are using the Name “Seaview Electronics”

- ^FS End of Field Data.

- FO20,60 Sets the field origin 20 dots to the right and 60 dots down from the home position defined by the ^LH instruction.

- ^AD Select font “D”.

- FD Start of Field Data.

- <DESCRIPTION > Part Description acquired from System Five.

- FS End of Field Data.

- ^FO40,160 Sets the Field Origin 40 dots to the right and 160 dots down from the home position defined by the ^LH instruction.

- ^BY2,2.0 Barcode Size. To decrease size change from a 2 to 1.

- ^BC Select Code 128 Barcode.

- N=Normal Orientation

- 100=Barcode Height.

- Y=Print Interpretation Line. Default is Y.

- N=Print Interpretation Line above Code. Default is N.

- N=UCC Check Digit. Default is N.

- N=Mode. Default value is N, no mode selected.

- ^FD=Start of Field Data.

- <PART, -1>=Part number of item obtained from System Five.

- ^FS=End of Field Data.

- ^XZ=End of label Format.

Printing Barcode vs. Barcode Numbers

There has also been some confusion regarding Barcode text lines and actual Barcodes. The System Five field <barcode> is the same, but the information to print the barcode number, or the barcode are completely different. For printing just the barcode number on a label, you will need to tell the printer what font you want to print as well as the size, orientation, and position on the label.

But for a barcode, you need to supply different information, such as the barcode type (3of9, 128, or UPC), the height and width of the barcode, and the position on the label.

So please carefully read the information in the examples below.

Line Wrapping

From version 6.1.0.1 up, System Five now support wrapping of a text field onto multiple lines. All earlier versions of System Five would only allow printing a single line of text, which would be truncated when it reached the far edge of the label, or it would wrap back overtop of itself when it ran out of room. So in order to take advantage of this new enhancement you will need to upgrade to the current release if you are not already on 6.1.0.1 or higher.

The most common use for this enhancement would be to have a description field that contains a long description to be printed on multiple lines. Also this enhancement looks for spaces in the field, so that words are not broken and separated onto another line.

To make use of this feature, you would no longer use the field <DESCRIPTION>, which is for a single line description. Instead you would substitute the field <DESCRIPTION#1,xx> for each line needed to accommodate your long description. the ”,xx“ is the maximum number of characters you define that will fit on that line of the label. If an entire word will not fit within the maximum number of characters, it will not be truncated. Instead that word and any remaining parts of the description will be carried down to the second line.

In this example we have limited the number of characters per line to 25.

 ^XA 
 ^LH55,30 
 ^FO20,10^CFD,27,13^FDCompany Name^FS 
 ^FO20,45^AD^FD<DESCRIPTION#1,25>^FS 
 ^FO20,85^AD^FD<DESCRIPTION#1,25>^FS 
 ^FO40,180^BY2,2.0^BCN,80,Y,N,N,N^FD<PART,-1>^FS 
 ^XZ 

If your label requires two separate description fields with word wrapping (say for a two part label or label with a tear-off section), you would use <DESCRIPTION#1> for the first description fields, and <DESCRIPTION#2> for the second description fields.

Additional Information

ZPL2 Programming Basics PDF

zplbasics.pdf

ZPL2 Programming Guide PDF

zserieszpl2.pdf

zebra_eltron_label_creation_via_zpl.txt · Last modified: 2017/09/05 15:20 (7 years ago) by swind