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 license file or a license key that will work for your environment.

Once you receive your license file or license key, to activate the library in full production mode, follow the instructions below to activate the license so the library runs in full production mode and not in demo mode.

Using the License XML File

Starting with library versions v2021R1 and above, we have implemented a new XML based license system. This new licensing mechanism will now be the default and offers the following benefits and improvements:

  • Single XML file for multiple product licenses
  • Supports optional features (OCR, etc…) per license

The XML license can be used to activate your library product using one of the following options:

Load the license file in Java using loadLicense()

In your Java code, call the loadLicense() method from within your code before making any calls to the library with the full path to the license xml file. The method is static and should be called without instantiating the class first.

// for jOfficeConvert
WordDocument.loadLicense("C:\\MyFolder\\qlicense.xml");
// or
ExcelDocument.loadLicense("C:\\MyFolder\\qlicense.xml");
// or
PowerPointDocument.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFAssemble
PDFAssemble.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFFields
PDFFields.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFImages
PDFImages.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFOptimizer
PDFOptimizer.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFPreflight
PDFPreflight.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFPrint
PDFPrint.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFProcess
PDFDocument.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFSecure
PDFSecure.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFText
PDFText.loadLicense("C:\\MyFolder\\qlicense.xml");
// for jPDFWeb
PDFWeb.loadLicense("C:\\MyFolder\\qlicense.xml");
Add the license file using a VM option

Use the the “-Dcom.qoppa.license” VM argument when launching your application.

java -cp jPDFProcess.jar;myapp.jar -Dcom.qoppa.license="C:/MyFolder/qlicense.xml" com.mycompany.myapplication
Include the license file in your jar

Include the qlicense.xml file in your own jar (or war file or resource folder) so that it is included in your classpath when launching your application. Do not change the filename as this is the hard-coded file name that our libraries are looking for.

Using a License Key (Older Versions and Special Situations)

Versions prior to v2021R1 will need to use the following options when activating license products.

1) Calling a method within your own Java code

Call the method setKey for 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

It is also possible to set the license 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.

Important: To activate the key using the command-line parameter or system property method, the host application needs to call the setKey() method 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);

Here are the vm argument to set the license key in your Java application classpath:

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

The system properties 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.

Tagged: