Skip to main content

Little Favours

Posted by editor on December 13, 2007 at 7:53 AM PST

Java2D picks up another trick: PDF support

Well, we've been teasing Josh Marinacci's big surprise all week, and now it's out, by way of an announcement at JavaPolis: the SwingLabs PDF Renderer. The project is an open-source, all-Java library that renders PDF data to Java2D, meaning it can be used in Swing or any other Java code that works with Java2D grpahics (like, say, mapping a PDF to a 3D surface in Project Wonderland).

So, for the sake of argument, why does Java need to support PDF? As the project explains:

PDF is one of the core file formats of the Internet, so it is very important for Java programmers to be able to both read and write PDFs. Great open source libraries like iText have long handled the writing half, but until now there has not been a good way to read PDFs using open source Java libraries. We hope that the community will embrace this PDF Renderer in ways we've never thought of. It could be used to draw on top of PDFs, share them over a network, convert PDFs to PNG images, or maybe even project PDFs into a 3D scene.

A set of javadocs is online, as is a Java Web Start demo, which lets you open arbitrary PDFs. Here's a look at it rendering a real-world PDF document, the QC1 proofs from a book (click for full-size):


The SwingLabs PDF Renderer is licensed under the LGPL. Surely you have PDFs, so go try it out.

Also in Java Today,
the project is migrating its repository from CVS ( to Mercurial (, and this change will effect all community members who are integrating code changes to repository. The migration to Mercurial is planned to be completed as soon as possible, but with a minimal impact on current development. A small team has been put in place to facilitate this migration. They will deliver documentation and training materials to the community before the switch is done. Expect messages on the NetBeans mailing lists with more detailed information during December and at the beginning of January. For more information, check out the NetBeans wiki pages on Reasons for the Move and the Migration Plan.

Kelly O'Hair has posted a set of answers to common Mercurial OpenJDK Questions. He takes on the topics of why Mercurial was chosen for OpenJDK, why no history was imported from the TeamWare or Subversion repositories, why multiple repositories are used for the project, and more. He goes on to say, "I'll add more to this as time goes on, assuming people find it useful. Add your questions to the comments, I'll try and answer them."

Today's Weblogs section focuses entirely on the Javapolis conference, starting with James Gosling's report
I had a great day at JavaPolis. Congratulations to Stephan Janssen, the Belgian Java Users Group, and everyone else involved: you all did a great job. It really was packed. The venue was a total mob scene.