When printing using java.awt.PrinterJob, why does it print each page at least twice (and sometimes much more than that)?
The root of this is that Java 2D printing needs to be able to print everything that Java 2D can render to the screen, and that includes translucent colours, images etc which cannot always be printed directly in Postscript or GDI except when printing everything as one big image, so the implementation tries to avoid this by calling first to discover the rendering that needs to be done for the page. If its simple opaque rendering then only one more call is needed to render the page. If there are translucent colours then multiple calls are done for “bands” down the page to limit the size of the image being generated and hence constrain peak memory usage.
Related Questions
- Im trying to print an Adobe PDF file from one of the library databases, but all its printing is a blank page. What should I do?
- When printing using java.awt.PrinterJob, why does it print each page at least twice (and sometimes much more than that)?
- How can I save paper by printing multiple pages onto a single page, and/or print on both sides?