^BC
Code 128 Bar CodePreview: partialDraws a Code 128 barcode — the symbology almost every shipping label uses for tracking numbers.
Syntax
^BCo,h,f,g,e,mParameters
| Parameter | Description and accepted values | If omitted |
|---|---|---|
| o | Rotation of the barcode.N normal, R 90°, I 180°, B 270° | Last ^FW value, else N |
| h | Bar height in dots, overriding ^BY for this field.1 to 32000 dots | Height set by ^BY |
| f | Print the human-readable interpretation line.Y or N — print the human-readable line | Y |
| g | Print that line above the barcode rather than below it.Y or N — put that line above the bars | N |
| e | Add a UCC check digit.Y or N — add a UCC check digit | N |
| m | Encoding mode. D is UCC/EAN-128 for GS1 data.N none, U UCC case, A automatic, D UCC/EAN | N |
How it works
^BC produces a Code 128 barcode from the data in the following ^FD. It is the default choice for carrier tracking numbers because it encodes the full ASCII set and packs digits two per symbol character, which keeps long numeric codes compact.
The height parameter overrides the default set by ^BY for this field. The interpretation line — the human-readable digits — is printed below the bars by default, and the third and fourth parameters control whether it appears at all and whether it moves above the symbol.
Mode D switches to UCC/EAN-128 for GS1 data, where the payload is wrapped in application identifiers. Mode A lets the printer choose subsets automatically, which usually produces a slightly narrower symbol than the explicit encoding.
Example
^XA
^BY3,3,90
^FO60,60^BCN,90,Y,N,N^FDZPLTOOLKIT^FS
^XZRendering…
How the preview on this site handles it
Drawn with a real Code 128 encoder, so the preview scans. Height, module width and the interpretation line are honoured. Rotation is not applied, and the UCC check digit and mode D wrapping are not yet reproduced.
Common mistakes
- Placing the barcode too close to the label edge. Code 128 needs a quiet zone of about 10 module widths on each side or scanners fail on it.
- Leaving the default module width at a high resolution, which produces a symbol far narrower than the scanner expects.
- Assuming the interpretation line is part of the height. The bars are h dots tall and the text is drawn below that, so the field is taller than h.