TUTORIALS
Viewer Tutorial:
Integrating PDF contents in your applications
As easy as 1, 2, 3...
Introduction
As an application writer, you might feel the need to
integrate PDF contents inside your applications. As we will see in this
tutorial, jPDF Viewer is the tool you're looking for. It provides a
rich API that allows you to easily integrate PDF document rendering
inside your applications.
But before we dive into the details, let's anticipate a few of the most common questions and provide you with some answers:
- jPDF Viewer is a 100% Java component that doesn't require any third party application.
Indeed, the only software required is a Java Virtual Machine, which can be found nowadays on any computer system.
The software itself is about 4Mb large, which is far from the 25Mb
required for Acrobat; this makes it a perfect candidate for thin
clients such as applets or WebStart.
- jPDF Viewer is meant for thin/fat client applications written using Swing (alternatively SWT or AWT can be used).
The component works on top of Java2D and uses the Swing API to present
a component interface. If you are looking into integrating PDF content
in a website, you might want to check jPDF Printer. It can render pdf pages to JPEG or GIF image formats.
- jPDF Viewer integrates smoothly with the other jPDF modules (template, signer, creator, encryption, etc., ...)
jPDF Viewer is actually one of the only viewers with support
for signatures, form fields, encryption and outlines. In fact, very few
of our competitors can offer such a large scope of features. Our
state-of-the-art pdf engine also knows how to correct erroneous
documents and minimize memory resources, something which might not seem
like much but which reveals all its benefits once you begin to render
large documents.
Levels of integration
jPDF Viewer provides three levels of integration:

| Name |
Description |
| RendererPanel |
This is the simplest widget element. The widget
implicitly knows how to render pdf pages using a given matrix layout.
In fact, a scrollbar will show if the pages cannot be fully displayed.
The API provides methods to get and set the page as well as to access
zoom, zoom mode, rotation, matrix display, etc., ...
|
| ViewerPanel |
This widget presents a set of toolbars, tabs, a
status/control bar and a wizard panel. It also has support for full
screen mode. Most of these elements can, of course, be hidden.
|
| ViewerFrame |
Finally, the ViewerFrame shows a full features
application including a window menu - along with the features of all
the previous widgets. As this class is a frame, its componentization is
difficult and it should be used As-Is. |
Where to go next?
At this point you should have a better understanding of jPDF Viewer, its features and how to integrate it.
Please use one of the following links to access the next tutorials.
RendererPanel tutorial
ViewerPanel tutorial
|