ZQ520 not printing images in CPCL mode

We have a large amount of existing CPCL code used in iOS applications that works properly when printing to the rw420 printer.

 

This same code also works with the ZQ520 except for the images. They do not print using this command even though the printer shows they are in permanent memory. This is the command used to print that also works on the rw420.

 

PCX 11 8 !<ERSLOGO.PCX

 

I tried a number of workarounds found on this blog and the web and nothing works except using this ZPL code to print the image:

 

^XA^FO0,0^IME:ERSLOGO.GRF^XZ

 

I have tried the following:

 

remove the extension

 

changed the extension to GRF

 

followed instructions in this knowledge based article to upload as PCX: https://km.zebra.com/resources/sites/ZEBRA/content/live/SOLUTIONS/8000/SO8519/en_US/Command_Line_Converting_PCX_Files.pd…

 

nothing worked. in fact, the above didn't work properly in ZPL either, it printed something but it was not the image we expected and seemed that the colors were inverted.

 

Any help with this is very appreciated. We really don't want to rewrite all the CPCL code into ZPL just to print images. This seems to be a bug in the ZQ520 firmware as it should be backward compatible.

philip koprowski
I was able to solve this by

I was able to solve this by saving the file in PCX 0 format. that is not mentioned in the knowledge base article.

It now prints in CPCL mode as expected.

The only issue is that shouldn't the link OS storeimage method have worked? I tried the latest api, which doesn't print images on the old rw420 printer if used, but it still didn't work for the ZQ520 using png format images. Considering that this worked on the rw420 not sure why it shouldn't on the zq520.

at least i have a solution now.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
The printer.StoreImage()

The printer.StoreImage() command works correctly if you create the printer object with:

ZebraPrinter printer = ZebraPrinterFactory.getInstance(PrinterLanguage.CPCL, connection);

The SDK reads the ZQ520 printer as a ZPL printer by default, even if the language on the printer is set to line_print or cpcl.  The command above fixes that.

Robin

Vote: 
Vote up!
Vote down!

Points: 1

You voted ‘up’


philip koprowski
Thanks for the info

Thanks for the info.

Unfortunately, that didn’t work. No error, but no image either.

What I wound up doing was:

1. Convert image to pcx, version 0, using Paintshop Pro

2. Followed the instructions in the knowledge base article to create one file that had the ZPL to store the image and the PCX file in it using the command line.

3. Sent the above file to the printer.

The image then printed as expected using the CPCL PCX command.

I just had to send that file using the FileUtil SendFiletoPrinter method before using the image. Not the easiest fix but really needed to get something out to our users that worked since the rw420 is no longer available.

Thanks for your help.

Phil Koprowski

Developer

Keeping You Fully Informed With No Surprises

Office: (248) 536-3000 x515

Fax: (248) 536-3001

www.zenacomp.com<http://www.zenacomp.com/>

<http://www.facebook.com/pages/Farmington-Hills-MI/ZenaComp/136236845607?... <http://www.linkedin.com/companies/zenacomp> <http://twitter.com/zenacomp>

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Phil, I'm looking into it

Hi Phil, I'm looking into it now.  Someone else is having the same issue. .  Hoping I can figure this out for you both. If not, I'll submit a bug.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Hi Phil,This is the code I

Hi Phil,

This is the code I used to store and print an image file from Android using the SDK to a ZQ520 printer:

private void printcpcl()

{

    String address = "AC:3F:A4:0C:8E:9D";

    String cpcl = "! 0 200 200 406 1\r\nPW 588\r\nTONE 0\r\nSPEED 6\r\nSETFF 203 5\r\nON - FEED FEED\r\nNO - PACE\r\nJOURNAL\r\n";

    cpcl += "PCX 100 134 !<nameFile.pcx\r\nT180 4 0 452 354 Text at the top\r\nT180 4 0 472 92 Text at the bottom\r\nPRINT\r\n";

     BluetoothConnectionInsecure connection = null;

    try

    {

        connection = new BluetoothConnectionInsecure(address);

        connection.open();

        ZebraPrinter printer = ZebraPrinterFactory.getInstance(PrinterLanguage.CPCL, connection);

        String path = FindPath();

        ZebraImageI image = ZebraImageFactory.getImage(path);

        printer.storeImage("nameFile.pcx", image, -1, -1);

        connection.write(Encoding.ASCII.GetBytes(cpcl));

    }

    catch (ConnectionException e)

    {

        Log.error("CPCLTEST", e.message);

    }

    finally

    {

        if ((connection != null) && (connection.isConnected))

            connection.close();

    }

}

The image file was a JPG file I had stored on my Android device.  I know you already have a workaround, but let me know if this helps.

Robin

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


philip koprowski
Hi Robin,We are using IOS.

Hi Robin,

We are using IOS. Maybe that is the issue.

Not the latest API, previous one. Latest breaks the old printer.

Maybe that is the key, new way with new api for both. Not sure.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Anonymous (not verified)
Sorry Philip, I should have

Sorry Philip, I should have asked.  There was an issue with the ZQ5 and how the iOS SDK handles images.  I recommend installing the latest firmware for your printer.  Updating the SDK API would also be helpful, but I understand the backward compatibility issues.

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments