Search code examples
zebra-printerszpl

Printing on two labels at the same time with ZPL


I have a roll of labels that are 5,1cm x 1,6cm (two per row) and I need to print two different labels on each row (expected result), but the print command of the ZPL format only prints one label and feeds the next, leaving the adjacent label blank.

This is the ZPL code that I have:

^XA
~TA000
~JSN
^LT0
^MNW
^MTT
^PON
^PMN
^LH0,0
^JMA
^PR8,8
~SD15
^JUS
^LRN
^CI27
^PA0,1,1,0
^XZ
^XA
^MMT
^PW871
^LL152
^LS0
^BY2,3,60^FT23,73^B3N,N,,N,N
^FDId_bono^FS
^FT90,120^A0N,47,46^FB220,1,12,C^FH\^CI28^FDId_bono^FS^CI27
^PQ1,,,Y
^XZ

I believe that I need to add in this label a shift to print side by side label-1 and label-2 and print two at I time, but I cannot figure out how to add a side-shift in the label.


Solution

  • You have to print both labels as a single format, using ^LH to shift the second label to the right the appropriate number of dots. Basically, something like:

    ^XA
    ^LH0,0
    ... left label here ...
    ^LHnnn,0
    ... right label here ...
    ^LH0,0
    ^XZ
    

    The first and third ^LH commands reset the home position. The second ^LH shifts it to the right nnn dots.