0 Replies Latest reply on Jul 27, 2018 6:57 AM by Yamanthak Kattegummula

    Cross browser compatability issues with ZPL command

    Yamanthak Kattegummula

        Hi,

       

      The below code is working in chrome and firefox but it its not working in IE 11 browser. we are trying to print the plain text on the labels using the zebra printer ZT220 on client side printer.

       

      Please help me on this issue resolved.

       

      <!doctype html>

      <html lang="en">

      <head>

        <title>Pr...

      <!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> 

      </html>