ZEBRA LABEL – Zebra label printer example

Top  Previous  Next

 

UnForm offers an optional Zebra printer driver, which produces ZPLII code.  Within the limits of the ZPL language, UnForm produces enhanced forms for Zebra printers in much the same way it does for laser printers.  Some key differences are: fonts are identified differently and are limited in scalability, shading is either 100% (black) or 0% (white), and the barcode command is more extensive and capable than the laser printer barcode command.

 

When executing a Zebra run, it is critical to tell UnForm how large the labels are.  This is done with a special syntax on the "-paper" command line option.  Also, UnForm needs to know what print density is used by the printer.  This is determined by the "-p zebran" option, where n is either 6, 8, or 12 dots per millimeter.  You may need to adjust this sample command line to match your Zebra printer, as it assumes an 8 dpmm printer and 3.25 by 5.5 inch label stock.

 

uf100c –i samplez.txt –f advanced.rul –p zebra8 –paper 3.25x5.5 –o zebra-device

 

This label is scaled to 40 columns and 35 rows.

 

[zebra label]

detect 0,1,"Zebra Barcode"

cols 40

rows 35

 

 

The prepage code block gets the PO number, setting it into a variable po$, and removing the PO number from the text with a set() function.

 

prepage{

po$=""

po$=cvs(get(2,16,10),3)

trash$=set(2,16,10,"")

}

 

 

The From and To sections draw boxes, change fonts, and re-allocate the lines of text from row 10 to row 14 with a series of text commands followed by an erase command.

 

# From section

box 1,1,39,8,3

text 2,2,"From:",font A

font 2,3,35,6,font 0,9

 

# To section

box 1,9.75,39,10.5,5

#text 2,10.6,"To:",font 0

text 3,11,{get(2,11,30)},font 0,12

text 3,12.25,{get(2,12,30)},font 0,12

text 3,13.5,{get(2,13,30)},font 0,12

text 3,14.75,{get(2,14,30)},font 0,12

text 3,16,{get(2,15,10)},font 0,12

erase 2,11,30,5

 

 

This group of commands prints three different barcodes on the label.  First, a postnet code is printed from the zip code located at column 2, row 15, for up to 10 characters.  Then a UPS maxicode barcode is printed with SDSI's address.  Last, a "3 of 9" barcode is printed using the variable po$, derived in the prepage{} code block above.

 

# bar codes

barcode 10,18.25,{trim(get(2,15,10))},Z,33

 

text 2,24,"Maxicode",font 0,10

barcode 2,25,{"999840956820000" + $0a$ + "SDSI"+ $0a$ + "2195 Talon Drive" + $0a$ + "Latrobe, CA 95682"},D

 

box 17,25,22,12,3

text 18,25.75,"Our PO No (in code 39):",font A,21

barcode 20,28,{po$},3,120,2,text above