Viewer: ZPL to PNG

The Viewer turns ZPL into an image of the printed label. One dot of the printhead is one pixel of the PNG, so the image shows exactly what the printer will print. Use it to preview labels before printing, show a label in your application, attach label images to orders or emails, or check in automated tests that a template renders what you expect.

The Viewer only shows labels. To let your users design label templates, use the Editor.

Live demo

Rendered in your browser by <zpl-viewer>.

Source (ZPL)

To try your own ZPL, open the Viewer playground: ZPL and options on the left, the label on the right as you type, and a button that renders the same ZPL on the server.

Three ways to use it#

All three use the same renderer and produce the same pixels.

WhereHowUse it forGuide
Your backendPOST ZPL to the install, get a PNG (or JSON with every label)Server-side previews, archiving, emails, automated testsRender from your backend
Your web page<zpl-viewer> from the install's /sdk/, rendered in the browserPreviews in your UI, with no server round tripEmbed in your page
A terminallabelviewer render (the same executable as the server)One-off renders and scriptsCommand line

The quickest test, from any machine that can reach the install:

curl -s --data-binary '^XA^FO50,50^A0N,50,50^FDHello^FS^XZ' \
    "https://labelviewer.example.internal/v1/printers/8dpmm/labels/4x6/0/" -o label.png

label.png is the label as an 812 x 1218 pixel image: 4 x 6 inches at 203 dpi.

What it renders#

ZPL II as a Zebra printer at 152, 203, 300 or 600 dpi prints it: text in the built-in and downloaded fonts, graphics, every common 1D and 2D barcode (each verified to scan), serial numbers and the clock. Commands it does not support are reported as warnings and skipped; the rest of the label still renders. How close the image is to a real print, and what to do when a label looks wrong: Fidelity & troubleshooting.

Running the install itself (Docker, configuration, upgrades) is covered in Install. Every endpoint is listed in the API reference.