Conversão de linguagens de impressora
Convert ZPL to TSPL: command equivalents and migration guide (Zebra → TSC)
How ZPL commands map to TSPL, what changes in units, fonts and barcodes, a real before/after label, and how to migrate a Zebra label library to TSC printers without redesigning.
Este artigo está disponível em inglês e espanhol.
Moving from Zebra to TSC is the most common printer migration in logistics and retail: TSC units cost less and the mechanics are compatible with the same labels and ribbons. The obstacle is the language. ZPL and TSPL describe the same things — a text at a position, a barcode, a box — with completely different syntax, so every existing ZPL template has to be rewritten unless something translates it for you.
Command equivalents
| Operation | ZPL (Zebra) | TSPL (TSC) |
|---|---|---|
| Start / end of label | ^XA … ^XZ | CLS … PRINT 1 |
| Label size | ^PW800 ^LL600 (dots) | SIZE 100 mm,75 mm GAP 3 mm,0 |
| Field position | ^FO50,40 (x,y in dots) | First two parameters of TEXT/BARCODE (x,y in dots) |
| Text | ^A0N,40,40 ^FDHello^FS | TEXT 50,40,"0",0,12,12,"Hello" |
| Code 128 | ^BY2 ^BCN,80,Y,N,N ^FD12345^FS | BARCODE 50,150,"128",80,1,0,2,4,"12345" |
| QR code | ^BQN,2,6 ^FDQA,data^FS | QRCODE 400,150,M,6,A,0,"data" |
| Data Matrix | ^BXN,6,200 ^FDdata^FS | DMATRIX 400,150,120,120,"data" |
| Box / line | ^GB300,2,2^FS | BOX x,y,xend,yend,2 / BAR x,y,w,h |
| Copies | ^PQ10 | PRINT 10,1 |
| Darkness / speed | ^MD15 ^PR4 | DENSITY 10 SPEED 4 |
What actually changes
- Units: ZPL works only in dots; TSPL accepts millimeters or inches in SIZE and GAP but positions in dots. A 203 dpi ZPL template moved to a 300 dpi TSC printer needs every coordinate scaled by 1.48.
- Fonts: ZPL's ^A0 is a scalable font sized in dots; TSPL's internal fonts 1–8 are fixed bitmaps with integer multipliers, and font "0" is scalable but sized in dots per character. Text widths will not match exactly — check labels with long product names.
- Barcode parameters: ZPL sets module width once with ^BY and reuses it; TSPL declares narrow and wide bar width in every BARCODE command. Human-readable text is a flag in both, but its font and position differ.
- Label origin and orientation: both use the top-left corner, but TSPL's DIRECTION and REFERENCE commands change where (0,0) sits; set them explicitly in every job.
- Graphics: ZPL ^GF hex bitmaps and TSPL BITMAP have different byte ordering and polarity; logos must be re-encoded, not copied.
- RFID: ^RF commands have no equivalent on non-RFID TSC models; on RFID-capable TSC units the RFID command set is different and encoding must be redefined.
Before and after: the same label
^XA ^PW812 ^LL609 ^FO40,30 ^A0N,36,36 ^FDSafety Harness^FS ^FO40,80 ^A0N,24,24 ^FDLOT: MX-24-0917^FS ^FO40,130 ^BY2 ^BCN,90,Y,N,N ^FD7501234567893^FS ^PQ1 ^XZ
SIZE 101.6 mm,76.2 mm GAP 3 mm,0 DIRECTION 1 CLS TEXT 40,30,"0",0,11,11,"Safety Harness" TEXT 40,80,"0",0,7,7,"LOT: MX-24-0917" BARCODE 40,130,"128",90,1,0,2,4,"7501234567893" PRINT 1,1
Note how the label size becomes physical units, every field carries its own coordinates, and the barcode declares its bar widths inline. The data — product, lot, GTIN — is untouched; only the wrapper changed.
Migration checklist
- Confirm printer resolution (203 vs 300 dpi) before scaling coordinates.
- Print every template once on the TSC unit and grade barcodes (ISO 15416); adjust narrow bar width if grades drop.
- Verify long variable texts do not overflow — TSPL fonts are wider at equal nominal size.
- Re-encode logos as TSPL bitmaps or, better, keep them as vector objects in the design tool.
- Keep the ZPL version in your library: mixed fleets are the norm during a transition.
How EtikStudio does it
Paste or import the ZPL file; the interpreter renders it as an editable design in millimeters. Choose a TSC printer profile and export: EtikStudio regenerates TSPL with coordinates scaled to the target resolution, fonts substituted with matching metrics, barcodes rebuilt by module and logos re-encoded. The same design keeps printing on the Zebra units until the last one is retired.
Os exemplos de comandos são simplificados para clareza; a sintaxe exata varia por modelo e firmware. Sempre teste na impressora de destino.