PDF became widely used file format to exchange documents. There are a quite a few open source API available to create PDF document from Java application. Almost there is no good open source API available to view and print the PDF content from Java application. Fortunately sun released a open source API to fill this gap.
It is called “PDF Renderer” API. Since the name says renderer many of you might think that it may not be suitable for printing. But it is possible to print PDF document using this API. The code is fairly simple, you can download from the below link. You need JDK1.5 to run this code. You can enhance the code to set more printer configurations based on your need.
Resource: https://github.com/venkatsalem/print-pdf
Reference: https://pdf-renderer.dev.java.net/
Edited on June 21, 2010
Since PDF Renderer open source doesn’t meet all my requirement, Now I am using a commercial Java API called Aspose.Pdf.kit for Java to print the PDF document.

Leave a comment