Print an image Android with Zebra ZQ510

S Said ZIANI 3 years 7 months ago
57 1 0

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();}}

Please Register or Login to post a reply

1 Replies

D Dmitry Prokhorov

Hello Said,
How long you have waited for this? What is a size of your image? Has it been stored on printer?
You can check performance improvement options in Best Practices document: Link-OS SDK - Zebra Technologies Techdocs

Dmitry Prokhorov
Software Engineer, Kutir Mobility
Posted on behalf of Zebra Technologies

CONTACT
Can’t find what you’re looking for?