Guides › Embed a ZPL Label Viewer in Your Own Site

Embed a ZPL Label Viewer in Your Own Site

Published:

If your documentation, support portal or internal tool ever shows ZPL code, you can show the rendered label next to it with a single iframe. No JavaScript library, no API key, no server-side code:

<iframe
  src="https://labelixa.com/embed/viewer#ENCODED"
  style="width:100%;height:420px;border:0"></iframe>

What goes after the #

The fragment carries a base64-encoded JSON object with the label:

const veri = {z: "^XA^FO50,50^A0N,40^FDHello^FS^XZ",
              d: "8",   // dpmm: 6, 8, 12 or 24
              w: "4",   // width in inches
              h: "6"};  // height in inches
const hash = btoa(unescape(encodeURIComponent(JSON.stringify(veri))));
iframe.src = "https://labelixa.com/embed/viewer#" + hash;

The easiest way to get a correct value: open the ZPL viewer, paste your label and use "copy link" — the part after # is exactly this format.

Why the ZPL travels in the fragment

The part after # is never sent in the URL of a request, so your label content does not end up in proxy logs, CDN logs or the Referer header. The embedded page reads it in the browser and renders through the same API as the main viewer.

Honest limits

The embed uses the anonymous rendering quota, which is fine for documentation pages and support threads but not sized for high-traffic product pages — for that, render server-side over the API with a key and cache the image. The iframe adapts to the height you give it, and a small "Labelixa" link stays visible under the label: that link is the price of the free embed.

Frequently asked questions

Do I need an API key to embed the viewer?

No. The embed runs on the anonymous rendering quota — enough for documentation and support pages. High-traffic pages should render server-side over the API with a key and cache the image.

Is the ZPL in the iframe URL sent to your servers?

The label travels after the # (the URL fragment), which browsers never send as part of a request URL — so it stays out of proxy logs, CDN logs and Referer headers. Rendering itself happens through the same API as the main viewer.

Can I remove the Labelixa link under the label?

No — the visible link is the price of the free embed. If you need an unbranded image, render over the API and serve the PNG yourself.

Related guides

What is ZPL?

ZPL is the language Zebra thermal printers understand. How to read the commands, how a label is put together, and the most common mistakes.

Which barcode symbology should I use?

EAN-13, Code 128 or QR? Practical rules for picking a barcode based on your data, your space and the scanner that has to read it.

How to preview a ZPL file without a printer

A ZPL file is just text — the label only exists once something draws it. Three practical ways to see a ZPL label before it reaches the printer.

Try your own ZPL code →