Why your ZPL file failed to convert

The three commonest reasons a label never reaches the PDF, two of them with no error on screen at all. How to spot each one by looking at the file, tested against the renderer EasyZPL uses.

A missing ^XZ at the end of a label

A ZPL label opens with ^XA and closes with ^XZ. The renderer does not treat an unclosed block as "an incomplete label worth salvaging": it simply finds no label at all.

^XA
^FO50,50^A0N,30,30^FDOrder 1234^FS

A file holding only that label will not convert: the converter reports that it found no labels at all.

The other case is the one that catches people out, and it is worse. If the file holds ten correct labels and one missing its ^XZ, it converts, and you get ten pages. The broken label disappears with no warning. Measured against the renderer EasyZPL uses: three good labels plus one broken return exactly three.

If the broken one sits in the middle of the file, it takes the next label with it. The open block keeps reading until it finds the next ^XZ, which belongs to the label below, and the two merge into one.

Nothing alerts you to this, which is why the check is worth doing twice. Count the ^XA and the ^XZ in the file, because the two numbers have to match. After converting, check that the PDF has one page per label.

A missing ^FS at the end of a field

Every drawn field ends with ^FS. It is easy to forget on the last field before ^XZ, because it looks as though ^XZ closes everything anyway.

^XA
^FO50,50^A0N,30,30^FDOrder 1234
^XZ

This label is lost too, for the same reason as the case above: the open ^FD swallows the ^XZ as if it were text to print, so the label is never closed. Every other label in the file comes out normally, and only this one goes missing.

Fixed:

^XA
^FO50,50^A0N,30,30^FDOrder 1234^FS
^XZ

The content sits outside the label area

This one is different from the two above: the file converts fine, and the PDF has the right number of pages. They are just blank, or missing pieces.

^FO positions in dots, not millimetres. How many dots fit depends on the density: at 8 dots per millimetre, a 101.6 mm wide label is 813 dots across. An ^FO900,50 on that label draws off the paper, and nothing complains.

The classic symptom is converting the same label at different densities and watching content appear at one and vanish at another, because the file was written for a 300 dpi printer and is being converted at 203.

What is not the problem

An unknown command does not break the file. If your ZPL uses a command this renderer does not implement, it is skipped and the rest of the label draws normally. If something is missing from the result but the conversion did happen, this is the likely cause, not a syntax error.

← All guides