PDF417 barcodes in ZPL with ^B7
To print a PDF417 barcode in ZPL, set the module width with ^BY and use ^B7N with the row height and the security level: ^BY2^FO40,40^B7N,6,3,,,N^FDOpenZPL PDF417 sample^FS. PDF417 stacks rows of code words, so it holds much more than a linear barcode in a wide, short block.
Atualizado 2026-10-20 · Renders made with the OpenZPL engine
Open in the viewerGenerator
4 × 2 in label at 203 dpi. A preview shows how the printer draws the code; confirm with a scanner before printing a run.
The ^B7 command
| Parâmetro | O que faz | Valores |
|---|---|---|
^BY w | Module width, in dots | 2 or 3 at 203 dpi |
^B7 o | Orientation | N, R, I, B |
^B7 h | Height of each row, in dots | for example 6 to 10 |
^B7 s | Security (error correction) level | 0 to 8 |
^B7 c | Data columns | 1 to 30; empty = the printer chooses |
^B7 r | Rows | 3 to 90; empty = the printer chooses |
^B7 t | Truncate the right side | N (standard) or Y (compact) |

^XA ^BY2 ^FO40,40^B7N,6,3,,,N ^FDOpenZPL PDF417 sample^FS ^XZ
Size in dots
The same 21-character text, rendered by the OpenZPL engine at 203 dpi:
| Settings | Size in dots |
|---|---|
^BY2, ^B7N,6,3,,,N | 240 × 60 |
^BY2, 4 columns | 274 × 48 |
^BY2, truncated (t = Y) | 172 × 60 |
^BY3, ^B7N,10,5,,,N | 462 × 160 |
More columns make the code wider and shorter; a higher security level adds code words and makes it bigger. Truncated PDF417 saves width but some scanners don't accept it, so prefer the standard form unless space forces you.
^BY2, rows of 6 dots, security 3

^XA ^BY2 ^FO40,40^B7N,6,3,,,N ^FDOpenZPL PDF417 sample^FS ^XZ
^BY3, rows of 10 dots, security 5

^XA ^BY3 ^FO40,40^B7N,10,5,,,N ^FDOpenZPL PDF417 sample^FS ^XZ
Valid and invalid data
- Text and digits of any kind; PDF417 is used on IDs, boarding passes and shipping documents.
- Escape
^and~with^FH, as in every field. - Very long data makes a code taller than the label; raise the column count to keep it short.
Check a barcode before printing a run
A preview shows how the printer will draw the code: bar widths, quiet zone and the human-readable line. It does not prove that every scanner reads it on your media. Print one label at the real density and scan it with the scanner your customer or carrier uses; for retail and logistics codes, a barcode verifier grades the print quality.
Perguntas
What is the difference between ^B7 and MicroPDF417?
MicroPDF417 (^BF) is a smaller variant for short data. The OpenZPL engine doesn't draw ^BF yet; see compatibility.
Why is my PDF417 too tall?
Lower the row height (second parameter of ^B7) or set more columns so the data spreads sideways.