Sun
has released a new open-source project as part of SwingLabs:
PDF Renderer, "a 100% Java PDF Renderer and Viewer." PDF Renderer can parse the
Portable Document Format (PDF) from a file and display it, as an AWT image, in a panel, or using any Graphics2D implementation. It has been released under the LGPL license, the same license used by the rest of SwingLabs. The project page identifies some potential uses:
- Viewing PDFs in your own application.
- Offering a print-preview for PDF files.
- Render PDFs to PNGs for display in a server-side web application.
- Incorporate PDFs in a 3D Scene.
- Draw on top of PDFs and Annotate them in a networked viewer.
Although this project was open open-sourced in December 2007, it has a longer history:
In 2003, researchers at Sun Labs developed the PDF Renderer as part of an audio collaboration tool, Sun(TM) Labs Meeting Suite, which is used extensively at Sun for distributed meetings. Meeting Suite was designed to allow people to give presentations created with OpenOffice.
At this point, the public project is still in the early stages, so the documentation is rough around the edges, and there is not yet a large community of users. However, by open-sourcing the project. Joshua Marinacci hopes the project will attract a community including developers who may contribute:
While the original code drop is from Sun, we want to get the community heavily involved. To make sure that happens we have recruited Tom Oke from Elluminate to run the project. He will act as project owner and lead architect. He is rapidly becoming an expert in the code and looks forward to discussing features with other contributors.
[W]e originally targeted OpenOffice exports, so a few things are missing. It implements most of the PDF 1.4 spec but is missing transparency, fill-in forms, and certain font-encodings. We hope that interested developers in the community will help us fill in these missing features.
Comparing the project to
other PDF libraries, Josh adds:
JPedal uses the GPL license, making it non-viable for certain applications. We think that the LGPL is a better fit for a library like this. iText is not a viewer/renderer. iText generates PDFs, it doesn't view them. This makes iText and the SwingLabs PDF Renderer great partners. I look forward to seeing how people combine them.