Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java printing - Enlarged printouts on a small number of printers

On some printers, for whatever reason, the printouts are automatically enlarged with what seems to be default settings when printing through the Java JVM (Java 7). This seems to be with older printers, and it's pretty rare, but it is happening with more than one printer model. Also upgrading the drivers doesn't resolve the issue.

The software uses the JFreeReport (classic engine) library, and when using the library to export as a PDF, everything is great. As well the Print Preview using the library is perfect. However when it comes to printing, and this is only with a very very small number of printers, the printouts are enlarged. They aren't zoomed in, but the fonts are much much bigger and improperly spaced so that they overlap over each others.

These same printers with JDK 6 seem to work fine. Seem, I'm still trying to isolate the issue. My thinking is that possibly these printers do not correctly support Java 7

Update: I found this thread which seems to indicate that there are some issues with JDK 7u21. I didn't see anything in the release notes to address this. In addition here is another example of the a similar bug report.

Update2: For anyone interested, I wrote a blog post called Printing is Broken on Mac OS X with Java 7 about this issue which contains more details and what I discovered.

like image 460
Stephane Grenier Avatar asked May 01 '13 22:05

Stephane Grenier


1 Answers

This is a known bug sadly. While there are a few workarounds (the symmetrical print resolution mentioned in your links, converting to a bufferedimage then printing that) I'm not aware of any fix as yet.

like image 174
MrB Avatar answered Oct 11 '22 06:10

MrB