PDF Java Toolkit

Using RELite to reader enable PDFs

Datalogics provides a simple command line tool with PDF Java Toolkit called RELite. RELite is provided as an executable Java jar file, and can be used to quickly and easily Reader Enable PDF documents.

Reader Enablement allows a user to set up a PDF document so that another user can open it in Adobe Reader and have rights, in Adobe Reader, to edit that PDF document. For example, a user could use Adobe Reader to add comments to a Reader Enabled PDF document, sign it, and save the document with form fields completed.

To enable a PDF file, a certificate from Datalogics is required. The certificate contains a signature that is part of the trust chain for the Adobe Systems root certificate that is in Adobe Reader. This certificate authenticates the document to Adobe Reader; which enables the editing features within Adobe Reader for the specific PDF document that was signed with the certificate.

These certificates are distributed as Personal Information Exchange Format (PFX) file, an archive format used for holding X509 certificates and private keys. Ask your Datalogics sales representative to provide you with a certificate and password.

Note that Datalogics also offers the Forms Extension, a plugin installed separately to work with the Adobe PDF Library product. When the Forms Extension is installed, it becomes a seamless part of the Library and is loaded when the Library initializes. The Adobe PDF Library is then able to manage and process form documents transparently to the user. With the Forms Extension, functions available in Adobe Acrobat for working with PDF Acroform and XFA forms documents are provided with the Adobe PDF Library, such as importing data to and exporting data from PDF form documents and flattening Acroform documents into regular PDF files, including generating appearances for bar codes and rendering them as bitmaps.

If you have a need to work with PDF forms documents, we would encourage you to consider Forms Extension.

For more information about RELite, contact your Datalogics support representative.

Running RELite with command line arguments

RELite will accept command line arguments so that you can specify all of the required inputs up front.

For example, if you are working with version 4.0.0 of RELite, the command to enter would be similar to the following with the parameters changed to reader enable your document with the options you would like:

java -jar relite-4.0.0.jar -in input\doc.pdf input\doc2.pdf input\doc3.pdf -out output\doc1-enabled.pdf output\doc2-enabled.pdf output\doc3-enabled.pdf -pfx eval.pfx -pfxpass ka7GfzI9Oq -rights formimportexport formadddelete spawntemplate

The required arguments are outlined in the following table:

-in Input file path and name
-out Output file path and name
-pfx PFX file name
-pfxpass Password for PFX file
-rights List of permissions

Running RELite interactively

To run RELite, at a command prompt, type:

java -jar relite-<version>.jar

where -<version> is replaced with the version number of RELite that you received. For example, if you are working with version 4.0.0 of RELite, the command to enter would be

java -jar relite-4.0.0.jar

The program will prompt you to enter the path name of the PDF file:

Enter path(s) to any input files to be reader enabled :

Enter the name of a single PDF document, if you have it stored in the same directory as the RELite.jar program file:

Sample.pdf

Or enter a path name with the PDF document, if you stored it elsewhere:

C:\PDFProject\input\sample.pdf

If you stored the PDF documents in a subdirectory under the directory where you stored RELite.jar, you don’t need to type in the full path name.

For example, if you stored the RELite.jar program file under C:\PDFProject and a set of PDF documents to enable under C:\PDFProject\Input, you could enter the path name for your PDF document like this:

Input\sample.pdf

You can also enter the names of more than one input PDF file, and the program will process all of the files, one by one.

Include the path name and file name for each file, each separated by a space, like this:

Input\sample.pdf input\sample2.pdf input\sample3.pdf

RELite will ask you where you want to put the new output PDF file it will create.

Enter output file path(s) (press enter to use RELites default output name):

You can enter your own path and file name, or simply press ENTER. By default, RELite will store your new PDF output file in a directory called “output” under the directory where you stored the RELite program, and add “-enabled” to the file name.

RELite will ask you to enter the path to your PFX file.

Enter path to pfx file:

Enter the path and file name of the PFX file you received from Adobe Systems, or move that PFX file to the same directory where you have your RELite jar file.

RELite will ask for the password for your PFX.

Finally, RELite will ask you to define the rights to assign to the PDF file to be enabled.

Enter rights to enabled with this PDF ('All' for full reader enablement):

Assigning Permissions to a PDF Document

RELite provides a set of 12 permissions to assign to a PDF document when it is opened in Adobe Reader.

You can simply type “All” and press Enter to assign every right to the PDF document. Or you can assign a limited set of permissions to the PDF document individually.

For example, if you assign the permission to annotmodify to a PDF document, that means that a person could open that PDF document in Adobe Reader and then create or change annotations in that document. That is, the user could add comments to the PDF or change comments added by another user who worked with the PDF document in Adobe Acrobat. If you assign formadddelete to a PDF document, a user can add form fields to that PDF document using Reader.

To assign a specific set of permissions to a PDF document, type a string of command names, each separated by a blank space, like this:

formfillinandsave formimportexport formadddelete spawntemplate barcodeplaintext

Make sure that you enter each permission command name in all lower case letters. We provide a list of the available permissions below.

formfillinandsave Fill in form fields on a PDF document and save the PDF document on a local machine, with the form values preserved.
formimportexport Import and export form data from a PDF document to and from FDF, XFDF, XML and XDP files.
formadddelete Add, change or delete fields and field properties on the PDF form.
submitstandalone Submit data from a PDF form to a server when the PDF document is not open in a browser session, by email or offline.
spawntemplate Create pages from template pages within the same PDF form.
signing Digitally sign and save PDF documents, and clear digital signatures.
annotmodify Create and change annotations in a PDF document, such as comments.
annotimportexport Save annotations, such as comments, from a PDF document to a separate data file, and import comments from a separate file into a PDF document.
barcodeplaintext When the user prints a PDF form document, the content entered in the form fields is captured in a 2D bar code that is then printed with the document. This permission prints a document with the form data added to the barcode in an unencrypted form that does not require licensed server software to decode.
annotonline Upload and download annotations such as comments to and from an online document review and comment server. Note that this command is no longer used for Reader 7 or later.
formonline Connect to web services or databases that are defined within a PDF form.
efmodify Update embedded file objects associated with a PDF document.

When the process is complete, the program will confirm that it completed successfully:

Reader enabled PDF file successfully generated at sample-enabled.pdf