Q: Does your PDF viewer jPDFViewer have an invert color mode?
To invert colors when displaying a PDF using our Java component jPDFViewer, jPDFNotes or jPDFEditor, call
where bean is either PDFViewerBean, PDFNotesBean or PDFEditorBean.
For typical documents,
the display will change from "Black on White" to "White on Black".
Inverting colors make things much easier to read when working in a dark room, on an airplane, or at night.
Q: What look and feel options do you recommend to use with Qoppa's Swing PDF viewing components?Tested Look and Feels
We can recommend the following look and feels. They were made them available as options within our end-user PDF editor called PDF Studio
which is based on our PDF components and libraries. PDF Studio is used
by thousands of end-users and we have found these look and feels to be
solid across platforms, on Windows, Mac OS X and Linux. See screenshots of the various java looks and skins
- The default OS look and feels for Windows, Mac, Linux
- Substance look and feel: Business, Business Blue Steel, Creme, Creme Coffee, Graphite
- Nimbus: Blue, Green, Gray, Red
Other Look and Feels:
There are probably other good Java look and feels to integrate but we have not tested them.
Synthethica: An issue was reported by one of our customer with this L&F where interactive text fields don’t work correctly. The input map / action map is done incorrectly, so key strokes like delete, backspace, left, right, home, end don’t work. We reported this to Jyloo Software, the developer, and they are working on improving this behavior.
Keywords: Look and Feel, l&f, Skins, Java, Customization, Robust, Reliable, Production Level, Professional
We've added a new API to our PDF viewing component
for back and forth navigation (go to previous and next view).
It will be released in jPDFViewer, jPDFNotes, jPDFEditor 2013R2 release scheduled for August 2013.
package contains the classes that provide access to the “browsing history” of a
document. This sample for navigating within a single document is provided in SimpleDocumentHistory. When a document
is loaded in PDFViewerBean, a
new LocationHistory is created
and maintains a list of Location’s
that have been viewed/visited. Adding “Next” and “Prev” buttons to the PDFViewerBean can be accomplished
using these classes along with a HistoryListener
that is added to PDFViewerBean.
is called, the Next/Prev buttons can be updated accordingly.
only maintains location history information for a single document. A containing
application can provide document history across multiple documents by using the
getLocationHistory and setLocationHistory methods to get and
set existing histories when navigating across documents. This sample is
provided in MultipleDocumentHistory. In order to implement this, you need to
save each LocationHistory with
its associated document. When a new document is loaded, a new LocationHistory object is created. PDFViewerBean calls HistoryListener.previousDocument()
when a request has been made to go to the previous location, but there are no previous
Locations in the LocationHistory of the current
document. In the MultipleDocumentHistorysample, the previous document is then loaded, and its associated LocationHistory is set in PDFViewerBean. Similar logic is used
for the next document. MultipleDocumentHistory
uses a flag to determine if it is loading a new document or loading a document
from its history list.
When loading a new document and saving its LocationHistory for later use, we do
not recommend using a reference to either PDFDocument or PDFSource as this will
cause every document in the history list to be saved in memory. MultipleDocumentHistory uses the file
path in order to reload the document from the history list, you can modify this to use URLs.
jPDFViewer is PDF Reader for Java. It is a Java Swing component to view PDF documents within a Java application or a web application.
jPDFViewer is just the component but it can be run in different
contexts, including in a standalone desktop application as well as inside an
applet inside a standard web browser.
We provide live sample PDF applets
to show how jPDFViewer can be used to display PDF documents in the browser. These applets are a good place to start for developers. We also provide the source code for the applets so our customers
can customize them to their needs.
There is a very rare issue of compatibility between java and certain graphics cards on Windows XP.
When this happens, the PDF will display scrambled, weirdly with some part that may repeat.
We found a few forums that reported similar problems.
Read this posting on Microsoft's website.
Here are a few things to try:
Your best bet is to update the driver for your graphics / video card.
- Another thing to try is to disable hardware
acceleration for graphics. To do this, right click on the desktop and
choose Properties. In the dialog that shows up, go to the Settings tab
and then press Advanced. The Advance dialog should / might have a tab
called “Troubleshoot” where there should be a setting to disable
- Try to change the settings on the graphics card to see if this will resolve the scrambled display.
to change the resolution of the monitor and see if this has any effect.
Changing the resolution to a lower setting has worked for some users.
Q: Where can I find jPDFViewer javadoc API?
A: You can find the API specification for the latest version of
our library jPDFViewer on our website at this link
jPDFViewer is a java bean to display PDF documents in Java applications and applets.
Q: When we print PDF documents using Qoppa's jPDFViewer component, the print margins are slightly different than Adobe® Reader®'s.
A: We actually spend quite some time making sure that our printouts match Adobe Reader / Acrobat® printouts as closely as possible. This is especially important for another one of our products, jPDFPrint
If there is a discrepancy, the most common issue is in the print settings:
When printing with Adobe, the print dialog has a number of settings to adjust the way that the content is mapped to the page. Of relevance, there are flags to “shrink to margins”, “expand to margins” and “center in page”. For instance, if shrink to margins is used, then the entire PDF page will be made to fit inside the printable margins for the printer.
We have the same settings in our java PDF renderer jPDFViewer
, but they are accessed programmatically. There is a class in the library called PrintSettings that has the same flags as the Adobe print dialog. By default, jPDFViewer has auto-rotate and shrink-to-margins turned set to true.
You can override this by calling PDFViewerBean.setPrintSettings (ps) where ps is a PrintSettings object with the flags as you need them.
If you match the flags in PrintSettings to the ones you use in the Adobe print dialog, then the printout should match.
If this is not the case, please send us the PDF that you are having problems with and we can test here.
As of version 5.30, jPDFViewer supports 5 languages: English, German, Italian, French, Spanish. jPDFViewer uses the default locale as reported by java: Locale.getDefault() to determine what language to use.
ViewerLabels.properties can be found inside the jPDFViewer.jar file and contains the English labels for jPDFViewer. In jPDFViewer.jar file are also packaged the files for the 4 other languages supported: ViewerLabels_de.properties (German), ViewerLabels_es.properties (Spanish), ViewerLabels_fr.properties (French), ViewerLabels_it.properties (Italian).
jPDFViewer can be customized to add other languages. The way to do so is to create a new file for each new language that contains the translations of jPDFViewer's labels in this language.
The file name's pattern for the new language needs to be:
where the language code is a valid ISO Language Code. These codes are the lower-case two-letter codes as defined by ISO-639. You can find a full list of these codes at a number of sites, such as:
So for instance for Spanish, you will have to create a new file called (this is just an example, the spanish file is already there so no need to create it)
If you'd like to further localize within a given language for a specific country, you can also add a file for that specific country
so for instance for Spanish in Mexico, you would create a file called
where the country code is a valid ISO Country Code. These codes are the upper-case two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as:
Note that the files don't need to contain all the labels but only the labels that need to be overwritten in this specific language / country. The other labels will be read by default from the previous file in the hierarchy.
The localization files need to be somewhere in the jPDFViewer path either packaged in a jar file or saved in a directory which is included the path.
Note that properties files are expected to be ISO-8859-1 files. For languages containing non-Latin characters such as Asian languages, the workaround is to create a file in utf8 encoding and convert it using the java utility called native2ascii which is located under the java bin directory (distributed with java 1.5). For instance to translate a UTF8 file called ViewerLabels_cz.utf8 with Chinese labels then make the following call:
native2ascii -encoding utf8 ViewerLabels_cz.utf8 ViewerLabels_cz.properties