Geertjan's Blog

  • January 1, 2011

Reading and Updating PDF Syntax on the NetBeans Platform

Geertjan Wielenga
Product Manager
RUPS (Reading and Updating PDF Syntax) is an internal tool used by core iText developers to debug PDF documents. I heard about it from Bruno Lowagie himself, while doing this interview at Devoxx. Bruno says, in that interview: "For the moment we've made the source code available, but we haven't provided it as a separate application. It would be nice to integrate it into IDEs, for example, so that you can open a PDF file and see what's inside, maybe via highlighted syntax."

From the javadoc: "iText RUPS is a tool that combines SUN's PDF Renderer (to view PDF documents), iText's PdfReader (to inspect the internal structure of a PDF file), and iText's PdfStamper to manipulate a PDF file."

This is what the tool looks like when you run it:

Within 15 minutes, it can be on the NetBeans Platform, which is the time it took me to get the process started, via a few very simple first porting steps:

No real benefits of using the NetBeans Platform in this context, at the moment. (Well, on the other hand, its now trivial to create a ZIP distribution or an installer per operating system, since tools exist for NetBeans Platform applications for these purposes.) A big benefit of porting to the NetBeans Platform will be the usage of the NetBeans Platform's docking framework, i.e., its window system. Each of the panels shown above should be in a separate window, so that each window can be undocked and moved, etc, separately from the other windows.

I.e., above, the tool is starting to be moved to the NetBeans Platform as a separate application, rather than as a plugin for NetBeans IDE, though that would be possible too. After the window system, i.e., each panel in a separate TopComponent instead of within a JSplitPane, the Nodes API should be implemented, so that the top left window (that would end up in the "explorer" mode of the window system) would display Nodes in a BeanTreeView, synchronized with all the other windows via an ExplorerManager.

It will also be cool to enable multiple PDF documents to be opened at the same time, rather than one at a time, which is currently the case. The Favorites window could be branded for those purposes, i.e., to provide a file browser. When opening a PDF document, the various windows shown above would open, similar to multiple windows opening together whenever a debug session is started for applications in NetBeans IDE. (Or there could be a view mode and a debug mode for PDF documents, the latter resulting in the above windows opening.)

For example, here you can see that multiple PDF documents can be opened in debug mode from the Favorites window; you can also see that there is integration with the NetBeans Platform's progress bar:

Anyone want to work on this as a medium sized exercise in getting your feet wet porting an app to the NetBeans Platform? Let me know.

In other news. If you want RUPS in NetBeans IDE, install the plugin here. It's very simple, same as shown above, once nodes and explorer views are added, within TopComponents, an update of the plugin will be provided.

Be the first to comment

Comments ( 0 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.