Conversão de linguagens de impressora
Convert SBPL to ZPL: bringing SATO label jobs to Zebra printers
SATO SBPL to ZPL equivalents, how to unwind SBPL's persistent positioning into ZPL fields, font and barcode mapping, and a worked example.
Este artigo está disponível em inglês e espanhol.
SBPL jobs usually come from a Japanese-designed ERP module or from SATO's own tools, and they are hard to read: escape sequences, four-digit coordinates, positions that carry over from one object to the next. Converting them to ZPL is mostly about making the implicit explicit — every field gets its own ^FO, its own font, its own ^FS.
Command equivalents
| Operation | SBPL (SATO) | ZPL (Zebra) |
|---|---|---|
| Start / end | <ESC>A … <ESC>Z | ^XA … ^XZ |
| Label size | <ESC>A1 0609 0812 (height, width in dots) | ^PW812 ^LL609 |
| Field position | <ESC>H0040 <ESC>V0030 | ^FO40,30 |
| Text | <ESC>L0202 <ESC>XU Hello (font + magnification) | ^A0N,36,36 ^FDHello^FS |
| Code 128 | <ESC>BG02090 data (narrow bar 2, height 90) | ^BY2 ^BCN,90,Y,N,N ^FDdata^FS |
| QR code | <ESC>2D30,L,06,0,0 <ESC>DN0004,data | ^BQN,2,6 ^FDQA,data^FS |
| Line / box | <ESC>FW02H0300 (line) / <ESC>FW0202V0100H0300 (box) | ^GB300,2,2^FS |
| Copies | <ESC>Q5 | ^PQ5 |
| Darkness / speed | <ESC>#E3 <ESC>CS4 | ^MD10 ^PR4 |
| Rotation | <ESC>%1 (90°), %2 (180°), %3 (270°) | ^FWR or orientation letter |
What to watch
- Positions: track H and V across the job; an SBPL object that omits H reuses the previous value. Each ZPL ^FO must receive the resolved absolute position.
- Fonts: SBPL bitmap font + L magnification → ZPL ^A0 with height computed from the font's base size × magnification; outline fonts map more directly.
- Barcode codes: BG → ^BC (Code 128), BD → ^BE/^B8 (EAN), BC → ^B3 (Code 39), 2D30 → ^BQ, 2D50 → ^BX. Heights are in dots in both.
- Human-readable lines added as separate SBPL text become redundant when ^BC prints them itself; remove them or keep them and set the Y flag to N.
- Japanese text: Kanji font commands have no ZPL twin except through Unicode (^CI28) with a downloaded TrueType font.
Before and after
<ESC>A <ESC>A1 0406 0609 <ESC>H0030 <ESC>V0020 <ESC>L0202 <ESC>XS Amoxicillin 250 mg <ESC>V0060 <ESC>L0101 <ESC>XS Lot B8297K <ESC>V0100 <ESC>BG02070 7601234567834 <ESC>Q1 <ESC>Z
^XA ^PW609 ^LL406 ^FO30,20 ^A0N,30,30 ^FDAmoxicillin 250 mg^FS ^FO30,60 ^A0N,18,18 ^FDLot B8297K^FS ^FO30,100 ^BY2 ^BCN,70,Y,N,N ^FD7601234567834^FS ^PQ1 ^XZ
The second and third SBPL objects never set H: they inherit 0030 from the first. The ZPL version states it every time.
How EtikStudio does it
The SBPL interpreter resolves the persistent positions, fonts and magnifications into a plain visual design; from there ZPL export is the same as for any other design, with barcodes and human-readable text rebuilt from one field.
Os exemplos de comandos são simplificados para clareza; a sintaxe exata varia por modelo e firmware. Sempre teste na impressora de destino.