Sign In
Products
ZPL ViewerBarcode GeneratorImage → ZPLZPL cheat sheetLabel DesignerTemplate Gallery
Developers
API QuickstartAPI ReferenceMCP ServerBulk GenerationWebhooksSDKs & ExamplesLimitsDirectPrint agent NewGitHub ActionVS Code extensionOn-Premise
Solutions
Logistics & ShippingE-CommerceERP & WMSManufacturingRetailHealthcare & LaboratoryAll solutions
Tools
ZPL Diagnostics HubZPL DebuggerSize & DPI AnalyzerDPI ConverterBarcode fit calculatorShipping Label AnalyzerFont InspectorOrientation DebuggerCalibration AssistantPrinter Compatibility CheckerBarcode Readability CheckerPrinter Language DetectorThermal Printer Test PackZPL ToolsEPL ToolsTSPL ToolsCPCL ToolsPrinter Language ConverterAll ToolsGuidesPricing
Language
EnglishTürkçeDeutsch
Home›Guides›Arabic text prints reversed or broken in CPCL

Arabic text prints reversed or broken in CPCL

Published:

A receipt from a Zebra mobile printer shows the Arabic customer name backwards, or with every letter in its isolated form instead of joined. The data is correct Unicode; the problem is what TEXT does with it.

Why it happens

Arabic and Hebrew are written right to left, and Arabic letters change shape depending on their neighbours. Both need a layout step before printing: reorder the characters for display (the bidirectional algorithm) and pick the joined form of each letter (shaping). We found no CPCL command for either in Zebra's CPCL programming guide. A CPCL TEXT command may therefore print the characters in the order received, each in its isolated form. Whether a given printer and font do better depends on the firmware; test on the actual device.

Three ways to print it correctly

  1. Send the text as an image. Render the line (or the whole label) as a picture on the computer, where the operating system does the layout, and send it with CPCL EG (EXPANDED-GRAPHICS). In EG a 1 bit prints black. Image to ZPL can output this directly: choose CPCL (EG) as the output language and you get a ready session (! header, PAGE-WIDTH, EG, PRINT).
  2. Switch the job to ZPL. Most Zebra mobile printers also understand ZPL. Zebra documents ^PA (advanced text properties) for bidirectional layout and character shaping on Link-OS printers, used with a TrueType font that contains Arabic. Check your printer's firmware documentation before relying on it.
  3. Prepare the text in the application. Shape and reorder the string before sending it (libraries exist for this in most languages). This only works if the printer font contains the Arabic presentation forms; many built-in fonts do not.

Find it before you print

The CPCL viewer flags any TEXT line that contains right-to-left letters (rule CPC2005) and draws EG graphics, so you can check the image route on screen first. Our CPCL support follows Zebra's CPCL guide and has not been verified on a physical CPCL printer.

Frequently asked questions

Why does Arabic text print backwards on my Zebra mobile printer?

Arabic needs reordering and letter shaping before printing. We found no CPCL command for either in Zebra's CPCL guide, so CPCL TEXT may print the characters in the order received, each in its isolated form.

What is the most reliable way to print Arabic with CPCL?

Render the text as an image where the operating system does the layout, and send it with CPCL EG (EXPANDED-GRAPHICS), in which a 1 bit prints black.

Related guides

ZPL vs TSPL: what actually differs

Label size in dots versus real units, job structure, text and barcode syntax — the ZPL and TSPL differences that actually cost porting time.

Previewing and debugging CPCL without a printer

Mobile printer labels rendered in the browser: the session header that controls everything, the findings that matter, and what is not drawn.

ZPL vs CPCL: desk printers and mobile units

Which to use: ZPL unless the printer is a CPCL mobile unit. Side-by-side command table, how to check and switch the printer language, and how to port a label.

TSPL BITMAP prints a black box

A TSPL BITMAP that prints as a solid black square almost always has its bits inverted: in TSPL a 0 bit prints black. Check the data, then fix it.

Try your own ZPL code →