ZPLToolkit

^B7

PDF417 Bar CodePreview: partial

A stacked 2D symbology that holds a paragraph rather than a number — the code on driving licences and shipping manifests.

Syntax

^B7o,h,s,c,r,t

Parameters

ParameterDescription and accepted valuesIf omitted
oRotation of the bar code on the label.N normal, R 90°, I 180°, B 270°Last ^FW value, else N
hRow height, as a multiple of the ^BY module width. Three or four is the usual range; one is unreadable.1 to the label height — multiplied by the ^BY module width^BY bar height, split across the rows
sError correction level. Higher survives more damage and takes more space.1 to 8 — error detection and correction0 — error detection only
cNumber of data columns. The usual way to control the symbol's width.1 to 30 — data columnsChosen for a 1:2 shape
rNumber of rows.3 to 90 — rowsChosen for a 1:2 shape
tTruncates the right-hand row indicators to save width, at the cost of tolerance for damage.Y or N — truncate the right row indicatorsN

How it works

^B7 prints PDF417, which stacks rows of a linear symbology into a block. It carries up to about 1,800 text characters in one symbol, which is why it is the format for identity documents, boarding passes and manifests where the label has to be readable without a database behind it.

Its error correction is what makes that practical. The security level `s` sets how much of the symbol can be damaged before it stops decoding: level 0 is barely more than a checksum, and levels 4 and 5 survive a torn or scuffed label. Higher levels cost space, so the usual choice is 4 or 5 for anything handled repeatedly.

Shape is controlled by columns and rows. Leaving both empty lets the printer aim for a 1:2 block; setting the column count is how you fit the symbol into a fixed-width area on the label. Note that the module width comes from ^BY and `h` multiplies it to get the row height — a PDF417 module is not square.

Example

ZPL
^XA
^BY2
^FO60,40^B7N,4,5^FDZPL Toolkit PDF417^FS
^XZ

Rendering…

A PDF417 at security level 5, with a 2-dot module width from ^BY and rows four modules — eight dots — tall.
Open in the viewer

How the preview on this site handles it

Drawn with a real PDF417 encoder, with the module width taken from ^BY and the row height from `h` times that width. Leaving `h` out spreads the ^BY bar height across the rows, the way the printer does. The truncate flag is ignored; rotation, the security level, columns and rows are honoured. Data the encoder cannot fit is drawn as a hatched red box.

Common mistakes

  • Leaving `h` at 1. That makes each row one module tall: the symbol encodes correctly and no scanner can read it. Zebra's own manual calls 1 a value not to use.
  • Security level 0 on a label that gets handled. PDF417's whole advantage is surviving damage, and level 0 gives that up.
  • Fixing both rows and columns for variable data. The moment the payload grows, the symbol no longer fits and the field fails.

See also