I have some problems when trying to print a PDF or an image (png/jpg). I'm using a ZQ320 printer, zpl its it current device.language. I get from an api a report in both png and pdf formats, both encoded in Base64
For the image, I been using the following code:
printer = ZebraPrinterFactory.getInstance(printerConnection);
printer.printImage(ZebraImageFactory.getImage(bitmap), 0, 0, bitmap.getWidth(), bitmap.getHeight(), false);
But when it prints, it prints/skips a lot of the paper and then it prints the image but its size is really small. I've tried replacing the bitmap with a 20x20px black square to check if maybe the image is the problem, but I get the same result, a lot of white paper skipped and the square prints but seems smaller.
So I tried, sending the pdf to the printer with this. The scaleMethod
I borrowed it from here
String scale = scalePrint(printerConnection, Uri.fromFile(file));
SGD.SET("apl.settings", scale, printerConnection);
printer.sendFileContents(file.getAbsolutePath());
But instead of printing the report it prints the information about the printer (serial number, program and other stuff). I've checked other methods from the example I found, and it seems I'm missing a pdf virtual device for the printer, I've checked it with the apl.enable
and it returns none
.
I've trying other formats for the image and pdf but I still keep getting the same results. How can I fix it?
The problem I had was caused because the printer's firmware did not support PDF formats. When we contacted Zebra's tech support, they told us to upgrade the firmware, and it worked fine