ESC+BG — Code 128
Plain English
Prints a Code 128 barcode — the most versatile 1D barcode that can encode all 128 ASCII characters. It automatically selects the most efficient subset (A, B, or C). This is the go-to barcode for most modern labelling applications.
When to use
For general-purpose barcodes, shipping labels, inventory, and anywhere you need to encode mixed alphanumeric data.
Syntax
ESC+BGabcdddddata
Parameters
| Parameter | Description |
|---|---|
a | Subset: 0=auto, 1=A, 2=B, 3=C |
b | Check digit: 0=none, 1=include |
c | Bar width ratio (1-4) |
dddd | Barcode height in dots (4 digits) |
data | The data to encode |
Example
ESC+A ESC+H0100 ESC+V0050 ESC+BG020100ABC-12345 ESC+Q1 ESC+Z
Code 128 barcode encoding "ABC-12345" with 100-dot height