Skip to content

Reference Implementation

Patrick Corless edited this page Jun 24, 2022 · 6 revisions

The ICEpdf Viewer is a reference implementation of a standalone PDF viewer application. You can use it as is, or as a starting point for your own custom application.

The application uses the SwingViewBuilder object to create the GUI elements in the viewer application, such as the toolbar and menu system. These GUI elements, including the page view, are controlled by the SwingController Object which produces a rich viewer application that can be used as is in most implementations.

Adding the maven dependencies to your project

<dependency>
    <groupId>com.github.pcorless.icepdf</groupId>
    <artifactId>icepdf-core</artifactId>
    <version>x.y.z</version>
</dependency>
<dependency>
    <groupId>com.github.pcorless.icepdf</groupId>
    <artifactId>icepdf-viewer</artifactId>
    <version>x.y.z</version>
</dependency>

Launching the Viewer RI

To start the ICEpdf Viewer via any maven project with the ICEpdf dependencies:

mvn exec:java -Dexec.mainClass=org.icepdf.ri.viewer.Launcher

Command Line Options

Option Description
-loadfile filename Starts the ICEpdf Viewer and displays the specified local PDF file. Use the following syntax: -loadfile c:/examplepath/file.pdf
-loadurl url starts the ICEpdf Viewer and displays the PDF file at the specified URL. Use the following syntax: -loadurl http://www.examplesite.com/file.pdf