Q: After purchasing a Server License for a Qoppa’s PDF library, how do I set the key so the library runs in full production and does not add the “Qoppa Software” watermark to the saved documents?

A: Once you purchase, we will ask you to send us server information so we can a generate a key that will work for your environment.

Once you receive your key, to activate the library in full production mode, follow the instructions below to set the key.

1) Calling a method within your own Java code

Call the method setKey from the library you purchased before making any calls to the library. The method is static and should be called without instantiating the class first:

// for jOfficeConvert
WordDocument.setKey("12345");
// or
ExcelDocument.setKey("12345");
// for jPDFAssemble
PDFAssemble.setKey("12345");
// for jPDFFields
PDFFields.setKey("12345");
// for jPDFImages
PDFImages.setKey("12345");
// for jPDFOptimizer
PDFOptimizer.setKey("12345");
// for jPDFPreflight
PDFPreflight.setKey("12345");
// for jPDFPrint
PDFPrint.setKey("12345");
// for jPDFProcess
PDFDocument.setKey("12345");
// for jPDFSecure
PDFSecure.setKey("12345");
// for jPDFText
PDFText.setKey("12345");
// for jPDFWeb
PDFWeb.setKey("12345");

For customers who have multiples servers and wish to have the same code running on all servers, it is recommended to use a hashtable to store the (hostname, key) combination for all the different servers and then query the hashtable by hostname to get the key.

2) Setting a vm argument or system property

As of v2014R1, we’ve added a way to set the key using system properties.

This allows your Java code to remain the same if you are running on multiple servers by using a different vm argument on each server.

The license key can be set through vm argument in your Java application call:

// for jOfficeConvert
java -Dqoppa.jofficeconvertkey=12345
// for jPDFAssemble
java -Dqoppa.jpdfassemblekey=12345
// for jPDFFields
java -Dqoppa.jpdffieldskey=12345
// for jPDFImages
java -Dqoppa.jpdfimageskey=12345
// for jPDFOptimizer
java -Dqoppa.jpdfoptimizerkey=12345
// for jPDFPreflight
java -Dqoppa.jpdfpreflightkey=12345
// for jPDFPrint
java -Dqoppa.jpdfprintkey=12345
// for jPDFProcess
java -Dqoppa.jpdfprocesskey=12345
// for jPDFSecure
java -Dqoppa.jpdfsecurekey=12345
// for jPDFText
java -Dqoppa.jpdftextkey=12345
// for jPDFWeb
java -Dqoppa.jpdfwebkey=12345

Important: To activate the key using the command-line parameter or system property method, the host application still needs to call the setKey() method, but should do so with a null value. So for instance for jPDFImages, you will need to make the following static call before making any calls to PDFImages:

// To set the key through a system property
// You still need to call the method setKey 
// in your code but with a null argument
PDFImages.setKey(null);

The system property can also be set by making a Java call:

// for jOfficeConvert
System.setProperty("qoppa.jofficeconvertkey", "12345");
// for jPDFAssemble
System.setProperty("qoppa.jpdfassemblekey", "12345");
// for jPDFFields
System.setProperty("qoppa.jpdffieldskey", "12345");
// for jPDFImages
System.setProperty("qoppa.jpdfimageskey", "12345");
// for jPDFOptimizer
System.setProperty("qoppa.jpdfoptimzerkey", "12345");
// for jPDFPrelfight
System.setProperty("qoppa.jpdfpreflightkey", "12345");
// for jPDFPrint
System.setProperty("qoppa.jpdfprintkey", "12345");
// for jPDFProcess
System.setProperty("qoppa.jpdfprocesskey", "12345");
// for jPDFSecure
System.setProperty("qoppa.jpdfsecurekey", "12345");
// for jPDFText
System.setProperty("qoppa.jpdftextkey", "12345");

Note: The property argument is case-sensitive.