Page 1 of 1

Print label on MS Edge

Posted: 27 Jun 2019, 00:26
by rsatoshi
Hi,

I have a button that prints a label when I click on it. It is working on Google Chrome, but not on Microsoft Edge. On Microsoft Edge, it opens a new window, but the window is blank. On Google Chrome, it opens a new window with the ZPL code (string), and I can print the label without any issue. How can I fix the Microsoft Edge issue?

Below is the button onClick script:

var Item = FIELDS("txtItem").getValue();
var ItemDesc = FIELDS("txtItemDesc").getValue();
var Room = FIELDS("txtRoom").getValue();

var zpl = /* ZPL code as string*/;

var printWindow = window.open();
printWindow.document.open('text/plain');
printWindow.document.write(zpl);
printWindow.document.close();
printWindow.focus();
printWindow.print();
printWindow.close();

Thank you!