• jPDFNotes

    jPDFNotes

    jPDFNotes

    Bean to embed in your Java applications and applets to annotate PDF documents and fill interactive PDF forms.

    TRY LIVE DEMO

jPDFNotes Live Applets Demo, Markup PDF, Fill Interactive PDF Forms

jPDFNotes Live Applet Demos

Live applet samples to markup PDF documents

Below are a few examples of applets to deploy jPDFNotes in a web application. If you’re not sure how you want to deploy jPDFNotes, contact us so we can point you to the appropriate sample.

  • Basic Applet – This is the simplest way to launch jPDFNotes, the page contains the jPDFNotes component in an applet and loads a document when the applet is launched.
  • Basic Applet with All Optional Jars – This is the same as above but with all optional jars included in the class path so this applet can handle PDF documents with digital signatures, CMYK content, and JPEG2000 images. Read more about optional jars.
  • Applet with Hidden Buttons – The buttons on the toolbar of jPDFNotes can be configured from the HTML that launches it. In this example, jPDFNotes is displayed without the open and print buttons.
  • Applet with Javascript Interaction – jPDFNotes can interact with Javascript to drive some of its interface. In this sample, we use Javascript to hide and display buttons, load other documents and set the page.
  • Applet loading from URL and saving to web server – jPDFNotes can be configured to load a PDF file from a URL and then to save it back to the web server when the user has make changes to it. To receive the file, the web server will need a script, we have samples of this script in PHP, ASP, ASP.NET and Servlet versions.
  • Applet getting a list of files from web server – jPDFNotes can be set to use a custom “opener” and “saver” to work with files straight from a web server or other types of servers. These are external interfaces that get called when opening and saving documents. In this sample, jPDFNotes loads files from the web server and saves them back to the web server, at the same location.
    • You can test this by pressing the open button on the toolbar, the list of files presented to the user come from the web server. When a file is modified and saved, the file is saved back to the web server.
  • Applet synchronized viewing of 2 PDF documents – jPDFNotes comes with a side by side comparison component which lets you scroll through 2 PDF documents in a synchronized manner and examine details and differences in the 2 documents using a sophisticated loupe tool.

Web Server Deployment

To deploy jPDFNotes on your website, you will need the HTML page that launches the jPDFNotes in an applet as well as the following two jar files.

  • jPDFNotes.jar – The main jPDFNotes jar file, contains the PDF viewing and editing component.
  • webnotes.jar – The Java applet that contains the jPDFNotes component. This jar file contains the source code to the applet so that you can modify to meet your needs.

Customizing the applet with parameters

When launching an applet, the HTML code can pass parameters to the applet to set any options that the applet supports.

In general, we recommend using the applet parameters to customize the applet dynamically, per document or per user. For instance, you may call the applet with a given PDF document to load, or hide the save or print button for a specific user with restricted permissions. The applet parameters can be easily set in PHP.

The applet then takes this parameters and can implement the options. In the applet used in these samples, we have defined the following parameters:

  • OpenURL – This parameter can be set to the URL of a PDF document to load when the applet is launched.
  • SaveURL – This parameter can be set to the URL of a server-side script that will receive files when they are saved. If this parameter is set, then the applet will not save to the local file system, but back to a web server instead.
  • MergeFDF – A URL to annotations in FDF format to merge into the document on load.
  • MergeXFDF – A URL to annotations in XFDF format to merge into the document on load.
  • OpenVisible – This parameter tells the applet whether to display the open button on the toolbar. Valid values are “true”, “false”, “1″ and “0″.
  • PrintVisible – This parameter tells the applet whether to display the print button on the toolbar. Valid values are “true”, “false”, “1″ and “0″.
  • ToolbarVisible – This parameter tells the applet whether to display the toolbar on the viewer. Valid values are “true”, “false”, “1″ and “0″.
  • Scale – This parameter tells the applet to set the initial scale. This is a percentage value with 100 being normal size.
  • DocumentList – This parameter tells the applet to use a custom opener that will get its list of files from an XML file from the given URL. The XML file will contain a list of PDF files that should be shown to the user and can include subfolders. You can look at a sample list here.

Please keep in mind that we have defined these parameters to illustrate the capabilities when deploying jPDFNotes in an applet. We provide the source code to this applet, so additional parameters and / or features can be added according to your needs.

Customizing the applet with an XML File

When started the applet will read settings from an xml configuration file, if present. This should be used to customize the applet in a definitive way, for instance to hide definitely the measurement tools or the save button. Some applet parameters (above) may overlap with the xml parameters and the applet parameters will always overwrite the parameters in the xml file.

Config Applet – This applets uses a config.xml file to hide annotations, stamps and add a custom text and image stamp buttons to the toolbar. You can right-click and choose “View Page Source” to view the source of the HTML applet. Read about the format of the xml config file  in our knowledge base to configure or customize the applet.

Custom opener / saver

For the custom opener and saver, you will need a couple of additional files / scripts on the server:

  • doclist.xml – This is an XML file that list the files that are available to the jPDFNotes client. The XML file contains information about each file’s name, source URL and save URL.

Additionally, you will need to have a script on the server that receives the PDF documents when they are saved. We have samples of this script using several technologies. After you download, you will need to modify the scripts slightly to set them to point to the folders in your web server:

  • upload.php – A PHP script to receive the PDF file.
  • UploadServlet.java – A Java servlet to receive the file. This servlet uses the Apache Commons I/O and FileUpoad packages to parse the multipart message. These jar files can be downloaded free of charge from the Apache website.
  • upload.asp and uploadlib.asp – Classic ASP pages that can receive the PDF content.
  • upload.aspx – ASP.NET script to receive the PDF content.

After downloading the files and placing on your webserver, you will need to edit the HTML file to set them to point to the location where you place the jar files.

If you need help with the implementation or customization of your applet, please contact us.