3 Replies Latest reply on May 10, 2016 2:37 PM by Alex Esquijarosa

    Print image problem on Zebra ZQ520 with Zebra Android SDK (ZebraPrinter)

    Vladimir Domes

      Hi,

      We have Android application which prints receipts as images. We use calling ZebraPrinter.printImage() method from interface GraphicsUtil.

      On older Zebra RW420 there is no problem (except for slow print), but same code doesn't work on new ZQ520. It prints a lot of hexadecimal characters.

       

      Same issue is when I print image from Zebra's Android application Zebra Utilities. Firmware version of our ZQ520 is V76.19.10Z.

       

      Does anybody know where the problem is?

       

      Thanks for your replies.

        • Re: Print image problem on Zebra ZQ520 with Zebra Android SDK (ZebraPrinter)

          Hello Vladimir,

           

          What language are you looking to use with your application? Is it ZPL? The ZQ520 uses line print as the default language, this means that whatever is sent to the printer is what will be printed exactly as it is sent. I would try changing the language on the printer and see if that makes a difference.

           

          You can send this command via Zebra Setup Utilities to change the language to ZPL (be sure to add a carriage return after this command): ! U1 setvar "device.languages" "zpl"

           

          If you need more details on how to send this command please let me know.

          Please try that and let me know if it resolves the issue.


          Thank you,

          Beverly

          1 of 1 people found this helpful
            • Re: Print image problem on Zebra ZQ520 with Zebra Android SDK (ZebraPrinter)
              Alex Esquijarosa

              I have a somewhat similar issue sending an image to the ZQ520 with Android SDK, but in my case nothing is printed at all. Same firmware version as well.

               

              Image format is PNG. This is the code I'm using:

               

              **********************************************************************************************************************************

              ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);
              Bitmap signature = Invoice.getInvoiceSignature(this.mContext, this.mInvoice.getPublicKey());
              printer.printImage(new ZebraImageAndroid(signature), 0, 0, signature.getWidth(), signature.getHeight(), false);

               

              **********************************************************************************************************************************

               

              Please advise. Thanks in advance.

               

              Kind regards,

               

              Alex.

               

              P.S.: Image does print from Zebra Utilities for Android.

                • Re: Print image problem on Zebra ZQ520 with Zebra Android SDK (ZebraPrinter)
                  Alex Esquijarosa

                  I solved it! The issue is that can't print an image alone (probably a bug). You need to set the flag 'insideFormat' to true, and call the printer.printImage(...) before the final statement. One thing I noted though is that th call to 'ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection)' needs to be done prior to the first 'connection.write(...).

                   

                  The following code prints the image:

                  ***************************************************************************************************************

                  String signatureFooter = "^XA^POI^PW830^MNN^LL600^LH15,0^CFD,9,5"
                     + "^FO0,0^FB792,1,,C^FDCustomer's signature^FS"
                     + "^FO140,30^GB550,450,1^FS";

                  connection.write(signatureFooter.getBytes());
                  printer.printImage(new ZebraImageAndroid(signature), xPos, 40, width, heigth, true);
                  connection.write("^XZ".getBytes());

                  ***************************************************************************************************************

                   

                  Hope this helps somebody.

                   

                  Kind regards,

                   

                  Alex.