Reputation: 409
I'm developing an app for Android that needs to print a PDF417
code as part of its functionality. I create the code using the TCPDF
and FPDF
libraries in a Linux machine, then the PDF is transfered to the app and it prints it in a Bluetooth ESC POS thermal printer.
However, for some reason I haven't been able to figure out, the PDF is always downscaled when printed. Meaning, if I print the PDF in a regular PC, the PDF417 code measures exactly the same size as I requested, and it can be easily scanned, while, when printing from Android, the output is always smaller than the original. I've tested using the app itself, who prints using Java, but also RawBT and ESC POS Bluetooth Print Service to discard any possible issue in the printer service, plus Adobe Acrobat and the Android native PDF reader to discard issues in the reader also.
Here is an image of the same PDF including the PDF471 code print in a regular laser printer (below) or the BT printer (above). The code was designed to measure 40mm/wide, as the scales shows for the laser print, but for the BT print, it only measures 38.5mm, and the effect is even worse if I enlarge the size of the code, for 50mm wide, the BT printer results is barely 45mm!!!
I have the feeling that the scaling is what causes the code to be impossible to be scanned (added to the fact the thermal printer quality is not so good either).
My question is: Is this behavior documented somewhere? Is there a way to avoid that unrequested scaling?
Thanks a lot for your help.
Upvotes: 0
Views: 704
Reputation: 409
I finally could figure out what was going on.
What happened was the PDF had some text going beyond its edges, and that caused the output to be automatically scaled to try to keep that text contained within the printing area. That effect (automatic scaling) doesn't happen in Windows.
So the solution was simply to ensure nothing touched the borders of the document and voilà!!! Problem solved, no more scaling.
Upvotes: 0