printing multiple images with RW420 printer on Android



We are building a project where we have to print multiple labels of patient details.


We are testing if we can print base64 converted images to the RW420 printer on an Android device over Bluetooth.

We have managed to print one label, but when we try to print multiple images in one row, it looks likes the device gets stuck.


We use the following code to print our images:



private void printImage(ZebraImageAndroid zebraimage, ZebraPrinter printer, Connection thePrinterConn) throws ConnectionException, ZebraIllegalArgumentException {


  Log.d(LOG_TAG, "Saving image to printer storage...");


  printer.storeImage("wgkimage.pcx", zebraimage, -1, -1);


  Log.d(LOG_TAG, "Printing image...");


  String cpcl = "! 0 200 200 ";

  cpcl += zebraimage.getHeight();

  cpcl += " 1\r\n";

  cpcl += "PW 750\r\nTONE 0\r\nSPEED 6\r\nSETFF 203 5\r\nON - FEED FEED\r\nNO - PACE\r\nJOURNAL\r\n";

  cpcl += "PCX 150 0 !<wgkimage.pcx\r\n";

  cpcl += "FORM\r\n";

  cpcl += "PRINT\r\n";



  Log.d(LOG_TAG, "write invoked...");




The logging shows the following output:


Saving image to printer storage...

Printing image...

write invoked...

Saving image to printer storage...

Error writing to connection: Broken pipe


After the second save, the program stops printing and shows the above error message.


Our first question here is if we are actually printing the image in the right way ?


Any help would be appreciated.