Problem when printing an image with zebra ZQ510 Android

S Said ZIANI 3 years 7 months ago
49 1 0

Hello,
I started printing an image with Zebra ZQ510 via an Android tablet but the printer still print me a string of characters that start with DGE: /storage/emulate.GRF and a sequence of characters.
Did you find any solution?

public static void  printImage(String imagePath,int x,int y, String macAddress){String theBtMacAddress = macAddress;Connection thePrinterConn = new BluetoothConnectionInsecure(theBtMacAddress);// BITMAPBitmapFactory.Options bounds = new BitmapFactory.Options();bounds.inSampleSize = 2;Bitmap localBitmap = BitmapFactory.decodeFile(imagePath,bounds);if (localBitmap == null){Toast.makeText(getApplicationContext (),"Null Source Bitmap.",Toast.LENGTH_SHORT).show();}int width = localBitmap.getWidth();int height = localBitmap.getHeight();// Create new bitmapBitmap newBitmap = Bitmap.createBitmap(localBitmap, 0, 0, width, height);//, matrix, true);if (newBitmap == null){Toast.makeText(getApplicationContext (),"Null Source newBitmap.",Toast.LENGTH_SHORT).show();}try {thePrinterConn.open();ZebraPrinter printer = ZebraPrinterFactory.getInstance(thePrinterConn);ZebraImageAndroid zebraImage = new ZebraImageAndroid(newBitmap); printer.storeImage("E:"+imagePath, zebraImage, 550, 412);printer.printImage(zebraImage, 0, 0, 550, 412, false);// Make sure the data got to the printer before closing the connectionThread.sleep(500);thePrinterConn.close();}catch (Exception e){e.printStackTrace();}}

Please Register or Login to post a reply

1 Replies

D Dmitry Prokhorov

Hello Said,

It seems you are trying to print using ZPL language while your printer is using CPCL language by default.
You need to set ZPL as page description language for your printer as it explained in Best Practices For Printing document.

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

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