What ^BY does
^BY sets the default module (narrow bar) width, wide-to-narrow ratio, and height for the barcodes that follow. Getting ^BY right is key to scannable barcodes — too narrow and scanners struggle, too wide and it won't fit.
Syntax
^BYw,r,hParameters
| Parameter | Description | Values | Default |
|---|---|---|---|
w | Module (narrow bar) width, dots | 1–10 | 2 |
r | Wide-to-narrow ratio | 2.0–3.0 | 3.0 |
h | Bar height, dots | — | 10 |
Example
^XA
^BY2,3,100
^FO50,50^BCN,,Y,N,N^FD123456^FS
^XZPaste this into the free ZPL viewer to see it render, or convert it to PDF.
Related commands
See the full ZPL command reference for all 92 documented commands.
