Last active
January 11, 2024 15:36
-
-
Save Lakerfield/1b77b03789525c9d0f13ddfeedee2efa to your computer and use it in GitHub Desktop.
Print ZPL from browser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
where do i get this generic driver?
I tested in chrome and edge, both printed as image.
See this stackoverflow answer https://stackoverflow.com/a/37137102
It's now 3 years later and Edge switched to chromium, so the only browser for this Firefox
@nxp2910 i tried the one which u suggested but not worked could please add some suggestion
@nxp2910 i tried the one which u suggested but not worked could please add some suggestion
Hey, sorry for the spammy reply, but QZ Tray (open source) can do this if you're interested and works with all Zebra printers, even the older ones. Full disclaimer, I'm the author of QZ Tray. 🍻
Other solutions include PrintNode (open source) and Neodynamic (closed source).
Best of luck!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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