PDFOne (for Java)
Create, edit, view, print & enhance PDF documents and forms in Java SE/EE
J2SE J2EE Windows Linux Mac (OS X)

A Java PDF Web Viewer - Powered By PDFOne (for Java™)

Showcasing an online PDF web viewer built using Gnostice PDFOne, our PDF component suite for Java™ developers.
By V. Subhash

Java's Write Once, Run Anywhere moto allows Java applications to run on a variety of platforms. This allows Java applications to be downloaded from a website and run inside a browser.

Inside a browser though, Java runs under a lot of restrictions. To give more freedom for Java applications to access system resources, you can bundle them as JNLP (Java Network Launching Protocol) clients using the Java Web Start framework.

In this article, we present you an online Java PDF viewer built by Gnostice DevTools Team member L. Santhanam using our PDFOne (for Java ™) library.

Screenshot 1: The Demo Can Display A Local PDF Document Inside A Browser

Online PDF Viewer Demos

Here are the demos. (You need the latest Sun JRE (Version 6 Update 20 or later) for these demos. You can download the JRE from the Java website. If you are using a Mozilla browser in Windows, you can simply update your Java plugin to get the latest JRE. Linux users, please see note below.)

  1. Download and run the demo outside this browser - click here.
  2. Run the demo as an applet inside this web page - click here.

How To Run The Demos

To run the first demo, download it and run it from your computer using Java Web Start Launcher. You may find it with the pathname C:\Program Files\Java\jre6\bin\javaws.exe.

Screenshot 2: Run The Demo With Java Web Start Outside the Browser

The second demo will run directly within this web page. When the Java application loads, Java will show a certificate prompt. Simply click the Run button on the prompt. Do not add the signature to your computer, as Santhanam had used only a demo certificate to sign the JAR files.

Screenshot 3: Digital Signature Prompt Before Running The Demo
  1. Both demos show trial marks.
  2. For Linux Users: Linux distributions now use the open source IcedTea Java runtime rather than HotSpot runtime from Sun. IcedTea is usually enough for most Linux users. However, there are some PDFOne components work best with HotSpot (Sun JRE) rather than IcedTea. As a result, these demos require Sun JRE. You can find installation steps for Sun JRE in Linux in another article. After following those steps, you need to ensure your browser uses the plugin from that JRE. If you are using Firefox in Linux, you need to create a symbolic link for the Linux Java plugin file in the Firefox plugins folder. On my Ubuntu Linux (Lucid Lynx) system, I searched for the Firefox plugins folder. I found it at /usr/lib/firefox-3.6.3/plugins. I found the Sun Java plugin for Linux libnpjp2.so at /usr/java/jre1.6.0_20/lib/i386. There was a javaplugin-oji.so in another location. However, Sun says that this other file is a classic plugin and should not be used. Finally, I created the symbolic link using the following commands in Terminal.
    cd /usr/lib/firefox-3.6.3/plugins
    sudo ln -s /usr/java/jre1.6.0_20/lib/i386/libnpjp2.so  .
    You can check your plugin installation by typing about:plugins in the Firefox address box.
    Screenshot 4: Check Whether Plugins Have Been Installed Properly
    Screenshot 5: PDF Viewer Applet Running Inside Firefox In Linux


Our .NET Developer Tools
Gnostice Document Studio .NET

Multi-format document-processing component suite for .NET developers.


A .NET PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, and bookmark PDF documents in .NET applications.

Our Delphi/C++Builder developer tools
Gnostice Document Studio Delphi

Multi-format document-processing component suite for Delphi/C++Builder developers, covering both VCL and FireMonkey platforms.

eDocEngine VCL

A Delphi/C++Builder component suite for creating documents in over 20 formats and also export reports from popular Delphi reporting tools.

PDFtoolkit VCL

A Delphi/C++Builder component suite to edit, enhance, view, print, merge, split, encrypt, annotate, and bookmark PDF documents.

Our Java developer tools
Gnostice Document Studio Java

Multi-format document-processing component suite for Java developers.

PDFOne (for Java)

A Java PDF component suite to create, edit, view, print, reorganize, encrypt, annotate, bookmark PDF documents in Java applications.

Our Platform-Agnostic Cloud and On-Premises APIs

Cloud-hosted and On-Premises REST-based document-processing and document-viewing APIs

Privacy | Legal | Feedback | Newsletter | Blog | Resellers © 2002-2024 Gnostice Information Technologies Private Limited. All rights reserved.