ZPLToolkit

Troubleshooting

The label is cut off at the edge

Content that runs off the label is either a field placed past the print width, a print width that does not match the media, or an origin shift that moved everything at once.

A field that does not fit

The commonest cause is the simplest: a field whose origin plus its own width lands past the edge. The printer does not wrap and does not warn — it images what fits and the rest is gone.

^XA
^PW812
^LL1218
^FO700,50^A0N,50,50^FDCustomer reference 88213^FS
^XZ
The field starts 700 dots in on an 812-dot label. Most of it never prints.

This is usually a data problem rather than a layout one. The template was laid out against a short value and then met a long one — which is why it survives testing and fails in production, and why validating each label catches what checking the template cannot.

A print width that does not match the media

^PW tells the printer how wide the printable area is, in dots. Set it wider than the media and the right-hand part of every label falls off the edge; set it narrower and the label prints correctly into a strip smaller than the stock.

The number is dots, not millimetres, so it changes with resolution. A 4-inch label is 812 dots at 203 dpi and 1218 at 300 — a ^PW carried over from a 203 dpi printer onto a 300 dpi one produces a label using two-thirds of the width, and one carried the other way runs off the edge.

^XA
^PW812
^LL1218
^FO50,50^A0N,50,50^FDCustomer reference 88213^FS
^XZ
The same field at an origin that leaves room for it, on a 4×6" label at 203 dpi.

Or everything moved together

If the whole label is shifted rather than one field, look at ^LH. It moves the origin that every later ^FO and ^FT is measured from, so a single ^LH50,50 pushes the entire design down and right by that much — and off the edge if it was already close.

^LH is often set once at the top of a template and forgotten, which makes it easy to miss when a design that used to fit stops fitting. It is worth ruling out before moving fields around: moving them compensates for the shift instead of removing it, and the next person to change ^LH inherits the mess.

Content cut off at the bottom rather than the side is usually ^LL, or a media-tracking problem that makes the printer stop early. If it is the latter, the label creeps between prints — that is the tell.

Check the layout in the validator

The overflowing field above, loaded and ready. The validator measures each field with the same font metrics the renderer draws it with, and reports the ones that leave the label.

Check the layout in the validator

Common questions

How many dots wide is my label?
Multiply the width in inches by the printer's resolution: a 4-inch label is 812 dots at 203 dpi, 1218 at 300 dpi and 2436 at 600. That number is what goes in ^PW.
The same ZPL prints correctly on one printer and cut off on another. Why?
Almost always resolution. Every coordinate in ZPL is in dots, so a label laid out for 203 dpi occupies two-thirds of the width on a 300 dpi printer and a label laid out for 300 runs off the edge of a 203.
Can I make a field wrap instead of running off the edge?
Yes — ^FB turns a field into a block with a width, a line count and an alignment, and breaks the text across lines. It is the right answer for an address; it is not a substitute for checking that the block itself fits.

Commands in this guide

Related guides