Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Print ZPL from browser
<!doctype html>
<html lang="en">
<head>
<title>Print ZPL from browser</title>
</head>
<body>
<h1>Test page for print ZPL from browser!</h1>
<script type="text/javascript">
function printZpl(zpl) {
var printWindow = window.open();
printWindow.document.open('text/plain')
printWindow.document.write(zpl);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();
}
</script>
</body>
<input type="button" value="Print zpl" onclick="printZpl(document.getElementById('zplcode').value)" /><br/>
<textarea id="zplcode" cols="40" rows="20">^XA
^FXTest ZPL^FS
^FO50,100
^A0N,89^FDHello ZPL^FS
^XZ
</textarea>
<p>Use the build in windows [Generic / Text Only] driver for your Zebra printer. Instead of the zebra driver. </p>
<p>Tested in: <b>Edge, Internet Explorer, Firefox</b></p>
<p>Not working in: Chrome (Chrome prints as image and not in text)</p>
</html>
@beppino

This comment has been minimized.

Copy link

@beppino beppino commented Jun 26, 2017

Hello, me too used this solution and it works very well! Until firefox 54... Have you even found this problem?

@CarMoreno

This comment has been minimized.

Copy link

@CarMoreno CarMoreno commented Sep 1, 2017

Hi, thanks for this solution was useful for me. :-)
I tested with Firefox 52 and working. With version 24 fail.

@nxp2910

This comment has been minimized.

Copy link

@nxp2910 nxp2910 commented Aug 1, 2018

Zebra has a new application called Browser Print. You can install that and use the js library they provide to print from the browser. When you install it will add a demo also. I used this recently and it works on chrome.

https://www.zebra.com/us/en/products/software/barcode-printers/link-os/browser-print.html

@tresf

This comment has been minimized.

Copy link

@tresf tresf commented Oct 21, 2018

There are several 3rd-party solutions that are compatible with Chrome (FF, Edge, Opera, IE) on Win/Mac/Linux:

https://stackoverflow.com/a/28783269/3196753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.