Published: · Updated:
An address or product name is longer than you planned and the end of
it is simply missing on the printed label, cut off at the right edge.
Nothing is wrong with the printer: a plain ^FD field is one
line of text, and ZPL does not wrap it for you.
A field made of ^FO, a font and ^FD starts at
its origin and runs to the right for as long as the data lasts. Whatever
passes the print width is not printed. This one is 58 characters at a
40-dot font, far wider than a 4-inch label:
^XA
^FO30,40^A0N,40,40
^FDShip to: Warehouse 7, Industriestrasse 114, 70565 Stuttgart^FS
^XZOpen this label in the ZPL viewer →
^FB (Field Block) formats the field into a block of text
with automatic word wrap, using the origin, font and rotation of the field
(Zebra guide, page 186). Its five parameters:
a — block width in dots. The default is 0, and if
the width is missing or smaller than the font width, the text does not
print at all. A ^FB without a width is the classic
"my text disappeared" mistake.b — maximum number of lines (1–9999, default 1).c — dots added to (or, with a minus sign, removed from)
the space between lines.d — justification: L, C,
R or J (justified; the last line is left
aligned).e — hanging indent, in dots, of the second and following
lines.^XA
^FO30,40^A0N,40,40
^FB740,3,4,L,30
^FDShip to: Warehouse 7\&Industriestrasse 114, 70565 Stuttgart^FS
^XZOpen this label in the ZPL viewer →
Two details in that example matter. \& inside the data
is a forced line break (page 187) — ordinary CR/LF characters in the
data are discarded, so pressing Enter in your template does nothing.
And the 30-dot hanging indent moves every line after the first one
inwards.
If the text needs more lines than b allows, ZPL does not
cut it off neatly. The guide is explicit: text exceeding the maximum
number of lines overwrites the last line (page 186). The result is an
unreadable smear on the final line. Either raise b, shorten
the data, or use a smaller font; changing the font size also changes the
block size, because the line height follows the font.
^FT instead of ^FO, the origin is the
baseline of the last possible line, so the block grows upwards and
a larger font can push it past the top margin (page 187).^FB; ^FS ends it.
The data string is limited to 3K (page 187).^FB does not support complex text; for that, the guide
points to ^TB (page 188).Wrapping is right for an address. For a product name that must stay on one line, three other things decide whether it fits, and each is a number you can check rather than guess.
^A0 is independent of the height. In our renderer the 58-character
line above measures 980 dots at ^A0N,40,40 and 735 dots at
^A0N,40,30 — the second one fits a 4-inch label (812 dots at
203 dpi) with the same 40-dot height. A 25 % narrower glyph is still legible
on a shipping label; a smaller font often is not.^PW600, or
with a printer default left at a narrower media, loses the right 200 dots
of every field. The size analyzer
reads ^PW/^LL out of a format and tells you the
physical size at each resolution.^FD splits the
data in the template — what ERP templates do when they cannot rely on
^FB — and ^FW rotates a long
field along the label's long edge, where a 6-inch label offers 1218 dots
instead of 812.Two neighbouring symptoms have their own pages. If boxes and barcodes are missing on the right as well, not only text, the label itself is being cut off — see ZPL label cut off. If the text is complete but sits off-centre, see centering text in ZPL. The full parameter table for the block command is on the ^FB command page.
Paste the format into the ZPL preview.
The preview follows the rules above: \& breaks the line,
a missing or too-narrow width prints nothing, and lines beyond
b are drawn on top of the last line — the same smear
the printer produces. The render API also returns a warning in the
X-Warnings header saying how many lines the text needed.
We have not verified these cases on a physical printer; the behaviour is
what Zebra's programming guide documents.
If the symptom is something else, the ZPL troubleshooting triage maps what the printer did to its usual cause.
A plain ^FD field is a single line and ZPL never wraps it. Whatever runs past the print width is not printed. Put the field in a ^FB block to wrap it.
Inside a ^FB block, \& in the data is a carriage return/line feed (Zebra guide, page 187). Ordinary CR/LF characters in the data are discarded.
The ^FB width defaults to 0, and if it is missing or smaller than the font width the text does not print (page 186). Give the block an explicit width in dots.
It is not truncated: text exceeding the maximum number of lines overwrites the last line (page 186), which prints as an unreadable smear. Raise the line count or shorten the data.
Yes: make the font narrower, not smaller. ^A0 takes height and width separately; in our renderer a 58-character line needs 980 dots at ^A0N,40,40 but 735 dots at ^A0N,40,30, which fits a 4-inch label (812 dots at 203 dpi). Also check that ^PW matches the real label width.
A layout that prints shifted has four suspects in the file — ^LH, ^LS, ^LT and the ^FO/^FT difference — before any sensor is to blame.
ZPL label cut off at the edgeA clipped ZPL label has two distinct causes: fields placed beyond ^PW/^LL, or a 300 DPI file on a 203 DPI printer. How to tell them apart and fix each.
ZPL label prints upside downA rotated ZPL label has three switches: ^PO flips the whole label, ^FW sets the default for every field, and each ^A rotates one field. Find which one is set.
Zebra label prints too smallA 4x6 label printing at two-thirds size in the top-left corner is a 203-to-300 DPI mismatch. Confirm it, see why ^MU rarely helps, rescale the file.