Adding features to a Java PDF Viewer
We have designed the Java PDF viewer examples so that it is very easy to enhance with additional features. In particular, we have featured example code to use features in iText - a free Java library.
iText is a PDF creation and editing library, whereas JPedal is a PDF viewing and PDF extraction library. Together these libraries make an unbeatable combination.
Preparation
Adding a new feature requires the editing and recompilation of the java source code files described. You will need jpedal.jar on your classpath for the code to compile. All the example files and the JPedal jar are on the downloads pages.
We recommend you use a Java Development IDE such as Eclipse, Netbeans or IntelliJ.
Once setup, adding a new function to JPedal requires the following steps:
- Add a unique constant to identify action.
- Link in command through executeCommand() method.
- Add a line to place on screen as menu option or button (or both).
- Add your code into ItextFunction or other external class.
- Test and debug.
Help with IText
iText has an active mailing list if you have any questions about the iText library.
Licensing issues
JPedal is released in 2 versions:
- under the LGPL license with full java source code
- an enhanced and supported version under a commercial license. In this version, the PDF Viewer code is also available to download and recompile as an example
I have added a feature to the PDF Viewer - Can I submit the code?
Definitely. We would be pleased to consider adding any submitted java code into the examples so you do not need to keep re-applying to new releases.
Return to main PDF support section
Click here for the main PDF support area with lots of java examples, PDF tutorials and useful information to get the most out of the JPedal PDF library




