Executive Summary

I just read about OpenZPL, a service for previewing and converting ZPL labels (the Zebra printer language) into PNG or PDF directly from the browser or via a REST API. What's interesting is that it's positioned as a drop-in replacement for Labelary, a similar API that's long been a go-to for many teams testing label printers.

Problem It Solves

If you've ever worked with Zebra printers, you know how unpleasant debugging ZPL can be - the code is text-based and there's no quick way to see the result without physically printing or using an emulator. OpenZPL solves this with a live viewer: just paste your ZPL code and you immediately see a preview of the label, then you can download it as PNG or PDF. No account needed to try it out.

Key Features and Code Example

Here's what stood out to me most:

  • A web-based live viewer for pasting ZPL and immediately seeing the rendered result, for either a single label or all labels in the file.
  • Download options for PDF (all labels or a single label), PNG per label, and also the original ZPL file.
  • A REST API for converting labels programmatically, free for up to 5,000 labels per day, with no sign-up required.
  • What makes it interesting: it's compatible with the Labelary v1 API - the URL, request body, headers, and even the X-Total-Count response header and error codes are the same. So if our code already uses Labelary, migrating is just a matter of swapping the hostname:
- https://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/
+ https://api.openzpl.com/v1/printers/8dpmm/labels/4x6/0/

Here's roughly what an API call looks like (an example, not from the source):

curl -X POST \
  --data-binary @label.zpl \
  -H "Accept: application/pdf" \
  https://api.openzpl.com/v1/printers/8dpmm/labels/4x6/0/ \
  -o label.pdf

Impact and Upgrade Notes

For teams that already have a Labelary integration, OpenZPL is practically a zero-effort switch - there's no need to change any client code at all, just swap one hostname as shown in the diff above. The free quota of 5,000 labels/day is also generous enough for testing needs or even small-scale production without having to create an account first.

---

First announced on Hacker News: Show HN. Read the original source for full details.