Home Contact Us

Qoppa Software - PDF Tools & Libraries

Home / Contact Us

jPDFSecure™ Source Code Samples

Following are a number of Java samples that use jPDFSecure and some of its features:

SignDocument.java - Apply a digital signature to a document. This program loads a document, then loads a digital ID from a PKCS#12 file, and then creates and signs a signature field on the first page of the document.

You can create a sample PKCS#12 file using Java's keytool program. The command line to create a test file is as follows:

keytool -genkey -keystore test.pfx -storetype pkcs12 -storepass store_pwd -keypass key_pwd -alias key_alias

SetPermissions.java - This program encrypts a document and restricts permissions to only allow printing.

ClearSecurity.java - This program clears the encryption and allows all permissions in a PDF document.

CustomSignature.java - This sample applies applies a digital signature to a document with a custom appearance. The appearance of signatures can be modified in jPDFSecure to include an image, choose the fields that show or custom text.

ListPermissions.java - This program lists the encryption and permissions settings of a PDF document.

Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.