Based on the tutorial here, I can separately print HTML and PostScript to an Epson T88V receipt printer using jZebra. I would like to use both printing methods on the same label - HTML for text & layout, PostScript for barcode rendering. Unfortunately I can only get one or the other to print, not both on the same label.
Here is the js which is contained in a print button click event:
// Text print
applet.appendHTML('<html><table face="monospace" border="1px"><tr height="6cm">' +
'<td valign="top">' + [some var value] + '</td>' +
'<td valign="top">' + [some other var value] + '</td>' +
'</tr></table></html>');
applet.printHTML();
// Barcode print
applet.append("\x1D\x77\x02\x1D\x6B\x49\x11\x7B\x41\x4C000288496\x508149");
applet.print();
If I run the code as-is, only the text is printed. If I comment out the text printing lines, the barcode is printed.
I've tried to use applet.clear();
after the first print and tried switching the order of printing but nothing changes. Is there a way to print a barcode and text in one go?
Yes what you request is possible, but you should not be using HTML and ESC/P commands interchangeably. Please refer to the ESC/P programmer's manual supplied by your printer manufacturer for printing text.
Here is a sample from ESCPCommands, taken from the jZebra wiki along with a quick explanation.
Credit for the code snippet goes to Bahadir from the jZebra mailing list.
-Tres