Konvertierung von Druckersprachen
Convert ZPL to CPCL: taking plant labels to Zebra mobile printers (QL, ZQ series)
ZPL to CPCL command equivalents for portable Zebra printers, the differences in units and structure, a before/after example and what to check for delivery and field labels.
Dieser Artikel ist auf Englisch und Spanisch verfügbar.
CPCL is the language of Zebra's portable printers — the QL and ZQ series clipped to a delivery driver's belt or a forklift. Many ZQ models also accept ZPL, but older QL units and some configurations only speak CPCL, and CPCL jobs are smaller and faster over Bluetooth. Reusing the plant's ZPL designs on the route means translating them.
Command equivalents
| Operation | ZPL | CPCL |
|---|---|---|
| Start / end | ^XA … ^XZ | ! 0 200 200 <height> <qty> … PRINT |
| Label size | ^PW ^LL | PW <width> and height in the ! header (dots) |
| Text | ^FO40,30 ^A0N,36,36 ^FDHello^FS | TEXT 4 0 40 30 Hello (font, size, x, y) |
| Scaled text | ^A0N,60,60 | SETMAG 2 2 before TEXT (integer magnification) |
| Code 128 | ^BY2 ^BCN,90,Y,N,N ^FDdata^FS | BARCODE 128 2 1 90 40 130 data (+ BARCODE-TEXT for HRI) |
| QR code | ^BQN,2,6 ^FDQA,data^FS | BARCODE QR 40 130 M 2 U 6 … MA,data … ENDQR |
| Box / line | ^GB300,2,2^FS | BOX x0 y0 x1 y1 2 / LINE x0 y0 x1 y1 2 |
| Copies | ^PQ3 | last number of the ! header, or PRINT repeated |
| Darkness / speed | ^MD ^PR | TONE 15 SPEED 3 |
What actually changes
- Header: the ! line fixes horizontal and vertical resolution (200 200 for 203 dpi), label height and quantity up front; ZPL declares size anywhere before printing.
- Parameter order: CPCL TEXT takes font and size before coordinates and puts the string last without quotes; forgetting the order produces text at (0,0).
- Fonts: CPCL fonts are numbered bitmaps with SETMAG integer scaling; ZPL's arbitrary ^A0 sizes round to the nearest magnification. Mobile labels are small — check that the rounding does not overflow the 2- or 3-inch width.
- Barcode text: CPCL prints the human-readable line only when BARCODE-TEXT is declared before the barcode; ZPL's Y flag has to be translated into that pair of commands.
- Battery and paper: CPCL jobs are sent over Bluetooth to a battery printer; keep graphics minimal and prefer printer-resident logos.
Before and after
^XA ^PW576 ^LL400 ^FO20,20 ^A0N,30,30 ^FDSJD-4587-22^FS ^FO20,60 ^A0N,20,20 ^FDDestination: Madrid^FS ^FO20,110 ^BY2 ^BCN,80,Y,N,N ^FDSJD458722^FS ^PQ1 ^XZ
! 0 200 200 400 1 PW 576 TEXT 4 0 20 20 SJD-4587-22 TEXT 7 0 20 60 Destination: Madrid BARCODE-TEXT 7 0 5 BARCODE 128 2 1 80 20 110 SJD458722 BARCODE-TEXT OFF PRINT
How EtikStudio does it
Select a mobile printer profile and the same design exports CPCL with the header computed from the label size, fonts rounded to SETMAG values with a warning if a text would overflow, and the barcode HRI wrapped in BARCODE-TEXT. From the mobile app, the driver prints the label on the belt printer; the plant keeps printing ZPL from the identical design.
Die Befehlsbeispiele sind zur Verdeutlichung vereinfacht; die genaue Syntax variiert je nach Modell und Firmware. Testen Sie immer auf dem Zieldrucker.