Why is printing to Postscript printers from Java slow, and can anything be done about it?
Have you ever wondered why your print job spool is so large in the printer queue when you’re printing from Java? The reason is that the Java Virtual Machine (JVM) automatically detects Postscript printers, and formats the page/s to be printed as a 32-bit per pixel color Postscript file. This will occur even if you have a black and white print job.
A one page, 1 MB TIFF file, for example, will become a 32 MB file in memory when it is being printed. If you consider how this could grow for multipage documents, it sometimes makes printing in Java less than optimal.
While there is no easy solution to speed up the process, using Java’s 1.4 Print Services API, you can send images to the printer in a more compressed form by saving the image to PCL or EPS using Snowbound’s RasterMaster for Java imaging SDK, and sending that data directly to the printer.
The other gain in using this method is that you can send compressed data to the printer (the JVM would send the data uncompressed). This compression could result in a 32 MB spool becoming a 150 KB spool, tremendously increasing the speed of your print jobs. While this possibility existed in earlier Java versions, the 1.4 Print Services API gives you a more comprehensive view of your available printers and printing options, allowing you to obtain better results than have been available in the past.