1 Reply Latest reply on Jan 3, 2019 8:00 AM by Dmitry Prokhorov

    Print an image Android with Zebra ZQ510

    Said ZIANI

      Hello, I want to print an image (Logo or customer signature), I followed the examples in the forums but I can not print the images but I printed text. When I click the print button the bluetooth light and print blink but no real reaction from the printer. I pass the mac address and the path of the image in parameter. here is the code I used, Thank you for your help.

       

      import java.io.IOException;
      import com.zebra.sdk.comm.Connection;
      import com.zebra.sdk.comm.ConnectionException;
      import com.zebra.sdk.comm.BluetoothConnection;
      import com.zebra.sdk.printer.PrinterStatus;
      import com.zebra.sdk.printer.ZebraPrinter;
      import com.zebra.sdk.printer.ZebraPrinterFactory;
      import com.zebra.sdk.printer.ZebraPrinterLanguageUnknownException;
      import com.zebra.sdk.comm.Connection;
      import com.zebra.sdk.comm.ConnectionException;
      import com.zebra.sdk.printer.ZebraPrinter;
      import com.zebra.sdk.printer.ZebraPrinterFactory;
      import com.zebra.sdk.printer.ZebraPrinterLanguageUnknownException;
      
      
      public static void  printImage(String imageFilePath,int x,int y, String macAddress)
      {
      String theBtMacAddress = macAddress;
      Connection thePrinterConn = new BluetoothConnectionInsecure(theBtMacAddress);
      try {
      
      thePrinterConn.open();
      ZebraPrinter printer = ZebraPrinterFactory.getInstance(thePrinterConn);
      
      printer.printImage(imageFilePath, x, y);
      
      Thread.sleep(500);
      thePrinterConn.close();
      
      }
      catch (Exception e){
      e.printStackTrace();
      }
      }