BDL Logo
 
ZPL Programming



ZPL - Zebra Programming Language

If you need to drive a Zebra barcode label printer from your own software application, whether it be a PC based application or from a mobile device without using a Windows printer driver, ZPL is the answer.

Using Zebra BarOne Version 5 (which is no longer available) I have designed a simple label: (if you don't have  copy of Bar One V5 then use BarTender Professional - see below)

BarOne allows you to design a label and 'print' the ZPL to a text file. The resulting ZPL code for the label design above is: 

^XA
^PRA
^LH0,0^FS
^LL384
^MD22
^MMR
^MNY
^LH0,0^FS
^BY3,3.0^FO52,28^B3N,N,100,Y,N^FR^FDHELLO^FS
^PQ1,0,0,N
^XZ
^FX End of job
^XA
^IDR:ID*.*
^XZ

You can copy this text and save it to notepad. Open a DOS window and use 'Edit' to view the text file. 

If you have a serial label printer, type:  copy filename.txt to com1 <enter> at the DOS prompt where filename is the name of file.

For a parallel printer, at the DOS prompt type: copy filename.txt lpt1 <enter>

Remember:

On a 203 dpi printer, there are 8 dots per mm.

On a 300 dpi printer, there are 12 dots per mm.

So to move the barcode right 1mm, we need to change the ^FO (Field Origin) in this line:

^BY3,3.0^FO52,28^B3N,N,100,Y,N^FR^FDHELLO^FS

from ^FO52 to ^FO60

To move the barcode down the label by 5mm, you would change the Y dimension of 28 to 68.

5mm means 8 dots per mm, times 5 = 40. So to move 1mm right and 5mm down the ZPL code would be:

^BY3,3.0^FO60,68^B3N,N,100,Y,N^FR^FDHELLO^FS

For everything you need to know about ZPL programming, download the user manual. 

 

 ZPL Programmers Reference Manual for Zebra printers

Use this guide for all Zebra desktop, mid-range and industrial printers.

  • LP/TLP2844-Z
  • TLP3844-Z
  • G-Series GK, GX
  • S4M
  • 105SL
  • ZM Series
  • Xi Series
  • QL, P4T mobile label printers
  • RW Road Warrior mobile receipt printers

 

 CPCL Programmers Reference Manual for Zebra printers

CPCL is ideal for the Zebra QL series, P4T and RW Road Warrior mobile label printers

CPCL Example

 

 EPL Programmer Reference Manual for Zebra printers  

EPL is available on the:

  • LP2844
  • TLP2844
  • G-Series printers
  • QL Plus mobile printers
  • RW Road Warrior mobile receipt printers
  • P4T

If you have to choose a language, my personal recommendation would be to use ZPL if the Zebra printer has the language on board. I find it easier to use and understand and using Zebra BarOne V5.0 it can generate the ZPL code for you if you design the label using the WYSIWYG designer.  

For the Zebra RW series use CPCL.

BarTender Professional allows you to output a label design to a text file automatically generating the ZPL code for you.

When you pop open the Print Dialogue box, File-> Print, click on Options, then tick the 'Print to File' checkbox. After you click on Print, you will be prompted to enter in a file name.

 

For more information on BarTender and to download the free 30 day trial version, click on the button.