My thorough research on the web provided me with a couple of ideas, but none of them seem to work correctly in my particular use case. Here is what I have:
1) Zebra
When printing to a Zebra printer, everything before ^XA and after ^XZ is ignored. The html tags around the zpl don't interfere.
The only thing you must ensure is that you print RAW text to the printer.
Use the build in windows Generic / Text Only driver for your Zebra printer. Instead of the zebra driver.
Example on jsfiddle or on gist.run
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();
}
Tested in
Not working in:
Select the Generic / Text Only driver in your printer properties: