Link
Skip to main content

Java PDF Viewer — View and Display PDF Files in Java

JPedal is a pure Java PDF library that includes a fully featured Java PDF viewer — embeddable directly into any Java application, with single and multipage display, text search, navigation, annotations, accessibility options, and a programmable API. It can be added to an existing application in 3 lines of code.

Getting Started

Viewing PDFs in the PDF Viewer
Adding the PDF Viewer to your application
Using PDF Viewer features

Customization

Customizing the PDF Viewer UI options
Adding additional languages to JPedal Viewer
PDF Viewer properties for accessibility
Replacing the PDF Viewers notification windows
Add custom actions to the PDF Viewer

Code Interaction

Selecting and Removing Text Highlights
Drawing additional objects to the PDF page

Modes

Viewing PDF Portfolio files
Using the PDF inspection tools

Frequently Asked Questions

How do I add a PDF viewer to a Java application?

JPedal’s viewer can be embedded in 3 lines of code:

Viewer viewer = new Viewer();
viewer.setupViewer();
viewer.executeCommand(ViewerCommands.OPENFILE, "path/to/file.pdf");

Full integration instructions are in Adding the PDF Viewer to your application.

What features does the JPedal Java PDF viewer include?

The viewer supports single and multipage display, text search, page navigation, bookmarks, annotations, form interaction (AcroForms and XFA), zoom, rotation, print, accessibility options, and a fully programmable API. The UI is customisable and supports localisation.

Can the viewer be embedded in a Swing or JavaFX application?

Yes. JPedal’s viewer is a 100% Java Swing component and can be embedded into any Swing application. It can also be used within a JavaFX application via a Swing interop wrapper.

Can I control the viewer programmatically from my code?

Yes. The viewer exposes a command API via executeCommand() using the ViewerCommands constants. This allows your application to open files, navigate pages, trigger search, and control display options without user interaction.

Can I customise the viewer’s appearance and UI?

Yes. Toolbar buttons, menu items, and UI panels can be shown, hidden, or replaced. The look and feel follows the host application’s L&F settings. Custom actions can be added to the viewer’s menus and toolbars.

Does the JPedal viewer support accessibility?

Yes. JPedal includes accessibility properties for high-contrast display, screen reader support, and keyboard navigation. See PDF Viewer properties for accessibility for configuration options.

Can the viewer display PDF Portfolio files?

Yes. JPedal supports PDF Portfolio (also known as PDF Package) files, which contain multiple embedded documents within a single PDF container.

Does the viewer support multiple languages?

Yes. The viewer UI can be localised by providing a properties file for the target language. See Adding additional languages to JPedal Viewer.

Can JPedal open password-protected PDF files in the viewer?

Yes. Pass the password programmatically via the viewer API before or during the open command.

Does JPedal require any third-party libraries for PDF viewing?

JPedal has no required third-party Java dependencies. There are no native binaries, no browser plugins, and no external rendering engines required.

What Java version is required?

JPedal requires Java 17 as a minimum — see Which Java versions does JPedal support?

Can I use the PDF inspector to debug PDF files?

Yes. JPedal includes a PDF inspector that exposes the internal COS tree, object dictionaries, decoded and raw stream data, and single-step debugging. It is accessible from within the viewer. See Using the PDF inspection tools.


Why JPedal?

  • Actively developed commercial library with full support and no third party dependencies.
  • Process PDF files up to 3x faster than alternative Java PDF libraries.
  • Simple licensing options and source code access for OEM users.

Learn more about JPedal

Start Your Free Trial


Customer Downloads

Select Download