1 Reply Latest reply on Jun 20, 2017 6:53 AM by Stephen Brennan

    ZQ520 Cancel Print

    Stephen Brennan

      I am developing an Android app which prints to a ZQ520 printer using CPCL and ZSDK.  A problem has been reported where extra copies of labels are printing, and I think it happens when the user has tried to print but the printer is switched off and then resubmits the print request once the printer is powered up.  Is there a way to cancel the failed request so that it does not print when the app eventually connects to the printer?  Here is my print method:


      private boolean zebraPrint(String content) {

         boolean retval = false;

         try {

         //PrinterStatus printerStatus = printer.getCurrentStatus();

         ZebraPrinterLinkOs linkOsPrinter = ZebraPrinterFactory.createLinkOsPrinter(printer);

        PrinterStatus printerStatus = (linkOsPrinter != null) ? linkOsPrinter.getCurrentStatus() : printer.getCurrentStatus();


         if (printerStatus.isReadyToPrint) {

         printStatus = BluetoothPrinterHelper.READY_TO_PRINT;

        System.out.println("Ready To Print");

        } else if (printerStatus.isPaused) {

         printStatus = BluetoothPrinterHelper.PAUSED;

        System.out.println("Cannot Print because the printer is paused.");

         return false;

        } else if (printerStatus.isHeadOpen) {

         printStatus = BluetoothPrinterHelper.HEAD_OPEN;

        System.out.println("Cannot Print because the printer head is open.");

         return false;

        } else if (printerStatus.isPaperOut) {

         printStatus = BluetoothPrinterHelper.OUT_OF_PAPER;

        System.out.println("Cannot Print because the paper is out.");

         return false;

        } else {

         printStatus = BluetoothPrinterHelper.UNKNOWN;

        System.out.println("Cannot Print.");

         return false;



         byte[] configLabel = content.getBytes("ISO-8859-1");


        retval = true;

        } catch (UnsupportedEncodingException e) {

         printStatus = BluetoothPrinterHelper.UNKNOWN;



        } catch (ConnectionException e) {

         printStatus = BluetoothPrinterHelper.DISCONNECTED;



         if (initialise())

         return zebraPrint(content);




         return retval;