• jPDFViewer



    Bean to embed in your Java applications and applets to view PDF documents.


jPDFViewer FAQ

jPDFViewer FAQ

This is the list of frequently asked questions for jPDFViewer. If you don’t find the answer to your question, don’t hesitate to ask us at info@qoppa.com.

Licensing Questions

What is your policy for annual support-renewal / upgrades?

When you purchase the library, 3 months of free support is included. This is normally enough to get the library integrated into your application and to work out any issues that may come up. Support includes answers to questions, priority bug fixes and free upgrades during the 3 month period.

Additionally, we also offer extended support renewable on a yearly basis. The extended support includes the same items as the initial 3 month support and is priced at 22% of the purchase price per year.

Is there an expiry date for the license?

There is no expiration on the license.

I don’t understand the jPDFViewer pricing as it relates to an applet. Should we estimate how many users use the applet or is there a per-server license fee?

Applet pricing works the same as distribution pricing. You have to estimate the total number of users that will be using the applet to come up with the required number of licenses.

Technical Questions

What version of Acrobat PDF does jPDFViewer support?

jPDFViewer supports all PDF file versions up to 1.7, the latest version of the Acrobat PDF format.

What type of fonts does jPDFViewer support?

jPDFViewer supports all fonts supported by PDF. This includes Type 0 (CID Fonts), Type 1, Type1C, Type 3 and TrueType.

Does jPDFViewer support searching?

Yes, jPDFViewer supports text search and text selection / copy to clipboard.

Is the toolbar configurable? Can I hide or disable the buttons on the toolbar?

Yes, the toolbar is completely configurable. Either the whole toolbar can be made visible/invisible and each of the individual buttons can be accessed directly.

Assuming that your bean is called pdfViewerBean, to hide the toolbar:
pdfViewerBean.getToolbar().setVisible (false);

To hide the print button:
pdfViewerBean.getToolbar().getjbPrint().setVisible (false);

To hide the open button:
pdfViewerBean.getToolbar().getjbOpen().setVisible (false);

Please look at the jPDFViewer documentation for more details.

Can jPDFViewer be used in an applet?

Yes, as jPDFViewer was created as a standard Java bean, it can be used inside a Java applet. Along with the sample program, we include a sample applet with the source code. You are free to take this code and use it for your own development. We’ve also created a few online applet demos.

I am running jPDFViewer in an applet. How can I sign the applet?

You need to sign the jPDFViewer.jar file as well as your applet jar file with your own certificate. All jar files must be signed using the same certificate, otherwise you will get multiple dialogs when you start the applet from a browser. Please follow this link for step by step instructions to sign your applet.

Does jPDFViewer have the ability to silent print, so I can send a PDF to a printer without having to preview it first?

You can do silent printing with jPDFViewer by simply not showing the PDFViewerBean in a form. However, you might want to look at another one of our products, jPDFPrint, that was designed specifically to do silent printing.

When printing a PDF file using jPDFViewer, it is clipping the top and bottom of the page. What am I doing wrong?

This might happen if the PDF pages are bigger than the printable areas on the printer (or at least those reported by the printer). To remedy this, jPDFViewer uses an object called PrintSettings which you can use to tweak printing.

The PrintSettings object constructor takes four boolean parameters:

  • autoRotate: Automatically rotates the page to fit the paper.
  • shrinkToPage: If the PDF pages are too big for the printer, it resizes the output to fit the printer’s paper.
  • expandToPage: If the PDF pages are too small, it resizes the output to fit the printer’s paper.
  • centerInPage: Centers the output on the paper.

In your case, it sounds like the PDF is slightly bigger than the paper, so when you create the viewer bean you would want to do the following:

PDFViewerBean bean = new PDFViewerBean();
bean.setPrintSettings (new PrintSettings (true, true, false, false));

Is it possible to use jPDFViewer bean to render a PDF page into an Image or BufferedImage?

There is a method of the PDFViewerBean called getPageView that takes a page number as a parameter. You can use the returned PDFPageView object to paint into any Graphics object, including a graphics object from a BufferedImage. The code to export page 1 to an image would look something like:

PDFPageView pageView = viewerBean.getPageView (1);
if (pageView != null)
BufferedImage image = new BufferedImage (pageView.getWidth(), pageView.getHeight(), BufferedImage.TYPE_INT_ARGB);

where viewerBean is a reference to a PDFViewerBean object.

Does jPDFViewer support JPEG 2000 images?

Yes, JPEG 2000 images are supported when running jPDFViewer under Java 1.4.2 (or above) with the JAI package installed. (Java Advanced Imaging).