Print images on ZQ210 using android linkos SDK

Hi, This is a follow-up on my previous question "Convert Android App for ZQ110 to ZQ210".

I try to print images on a ZQ210 printer using the android linkos sdk but have difficulties to find the best way to do it because the printer uses the linkos sdk but is not a linkos printer and supports only CPCL.

I'm using line print mode.

I have two kind of images to print : a header that is the same for every print and signatures that are different each time.

I would like to upload the header on the printer and then use the file using the PCX !<LT>SAMPLEPCX.PCX<CR><LF> syntax to print the image without having to send it each time to the printer.
As printer.storeImage can't be used to send the image to the printer, is it still possible to upload a file to the printer? For example, can I use the CISDF command to upload the PCX file to the printer?

For the signatures, I would like to send them each time, but even for that I'm stuck as I don't find how to convert the android bitmap to PCX and send the binary to the printer after the PCX command.

Any help on what functions of the LINKOS SDK I can use to convert the image and send it to the printer?

Steven Si
1. You can still use the

1. You can still use the storeImage() API in the Link-OS SDK to store a PCX image on the printer's flash. Just make sure to specify the PrinterLanguage.CPCL or PrinterLanguage.LINE_PRINT when obtaining the ZebraPrinterFactory instance.

// Don't use this for CPCL printer, as it is default to ZPL printer
// ZebraPrinter printer = ZebraPrinterFactory.getInstance(connection);

// Instead, use the following with explicitly specifying the PrinterLanguage,
// with either PrinterLanguage.CPCL or PrinterLanguage.LINE_PRINT for CPCL printers.
ZebraPrinter printer = ZebraPrinterFactory.getInstance(PrinterLanguage.LINE_PRINT, connection);

// This will store MYPICK.PCX on to the printer's flash.
printer.storeImage("E:MyPick", new ZebraImageAndroid(bitmap), 550, 412);

2. For capture the signature, you can refer to "sigcapture" demo inside the DeveloperDev_Demo project, which comes with the Link-OS SDK for Android. Again, we need to use the CPCL printer instance when printing the signature.

// Use the following with explicitly specifying the PrinterLanguage,
// with either PrinterLanguage.CPCL or PrinterLanguage.LINE_PRINT for CPCL printers.
ZebraPrinter printer = ZebraPrinterFactory.getInstance(PrinterLanguage.LINE_PRINT, connection);

Bitmap image = signatureArea.getBitmap();

printer.printImage(new ZebraImageAndroid(image), 0, 0, image.getWidth(), image.getHeight(), false);

 

Vote: 
Vote up!
Vote down!

Points: 0

You voted ‘up’


Log in to post comments