Installing the iText license key and license key library for Java and .NET

Thank you for your interest in our PDF library, we hope you will enjoy using our product and share your experiences with us and the iText community. We will walk you through the installation process of the iText license key and library.

If you are interested in getting support from our in-house developers and/or a license key for commercial iText products, you will need to acquire a commercial license.

NOTE: These instructions apply to both iText 5/iTextSharp and its successor iText 7.

Introduction

  • To use iText’s proprietary libraries you need to install a valid license and the license key library. Get a valid license.
  • Loading a license will display a producer line on PDFs, which you can check to ensure you are using the correct license type. The producer line is (in the case of iText 7) “iText ® 7.x.y © 2000—2019 iText Group NV”, followed by a suffix. This suffix is:
    • “AGPL version”, when not using the licensing library or when using an invalid/expired license;
    • “Trial version”, when using the licensing library and a valid trial license;
    • “Licensed version”, when using the licensing library and a valid license.

Pre-installation

The requirements to install the license and the license key library are as follows:

  • Obtain a valid license. For iText’s proprietary libraries a valid (trial or commercial) license is required.
  • After accepting the terms of use, download the license file through the portal by selecting it and clicking on 'Download Selected Keys'. It will download in a zip file containing an XML file named (for example) “itextkey.xml”. This is a XML file with information about who you are, and a key that allows you to use the software.
  • To be able to load this license file you need an additional library—the license key library. If you have previously downloaded the license key library, please make sure you have the latest one.
  • The license key will work for iText 7 (and iText5/iTextSharp) and for the add-ons.

Library installation and loading the license key

You'll need two things:

  • the license key file, and 
  • the latest version of the license key library.  Our current license key library for both iText 5 and iText 7 is version 3.x.x.

Download the license key library:

NOTE: For iText versions 5.5.13 and later, we changed to use the same license key version as for iText 7. Download the license key library from the iText 7 link below for Java or .NET.

Java

 

The license key library (itext-licensekey-x.y.z.jar) needs to be on the classpath. It can be downloaded from our repository.

You can also use Maven to resolve this dependency. To do so, add the iText Artifactory server, https://repo.itextsupport.com/releases, as an additional repository in the repositories section of your pom.xml, as described in the Maven documentation. Then you can add the following dependency to your dependencies:

<properties>
       <itext.version>RELEASE</itext.version>
</properties>
<dependencies>
  <!-- iText 7 License Key Library -->
  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itext-licensekey</artifactId>
    <version>${itext.licensekey.version}</version>
  </dependency>
</dependencies>

.NET

Load the license key

Java

The license key library (itext-licensekey-x.y.z.jar) needs to be in the classpath.

.NET

The license key library (itextsharp.licensekey.dll) needs to be added as a reference to your project.

 

The license key file (typically itextkey.xml) needs to be loaded before calling the proprietary code. This is done using the static method of the LicenseKey class:

LicenseKey.loadLicenseFile("path/to/itextkey.xml")
LicenseKey.LoadLicenseFile("path/to/itextkey.xml")

NOTE: You'll need to call this line of code before any other iText API call. Not loading the key at startup might result in the producer line having a reference to "AGPL" instead of your company name.

 

Enable the automated monitoring of volume licenses (Capacity Rental License)

With the release of version 3.0.0 of the license key library, we introduced a volume based counting mechanism. The mechanism works with an event system through which iText and its add-ons will send events.

When the volume license key file has been loaded, the statistics concerning usage will be sent to our servers. This means the machine that runs your application needs an active Internet connection. The information collected is consistent with the terms of the SLA and is restricted to the quantity of PDF files generated, modified, adapted, stamped, filled in, inspected or otherwise processed.

For more information, click here to read our guide showing you how to enable the automated monitoring of volume licenses (Capacity Rental License).

Troubleshooting

Common Error messages

I get "version mismatch error"

You are most likely combining the wrong library version with your license key. If you are using version 5.5.13 or later of iText 5/iTextSharp, it uses the same license key version as iText 7. Download the license key library from the iText 7 link below for Java or .NET.

For older versions of iText 5/iTextSharp use version 1.0.4.

Java

.NET

I get "signature corrupted"

This can mean a few things:

  • The license key file was corrupted during the download. Try downloading it again and loading the newly downloaded file. If the issue persists, contact us so that we can resolve this issue.
  • You changed the contents of your license key. Please revert the license key to its original state. If you want to change the content of the key, please contact our sales department.

I get "product not found"

You are trying to use an add on product without having loaded a license key that contains a valid license for that product. If you bought a license for the add-on, please contact our sales department to rectify this. If you didn't buy a license and you want to try out the add on, you may want to register for a trial license.

I get "The license info of already loaded license doesn't match the new one."

You are most likely trying to load an additional license key containing new add-ons. This can only work if the core information is the same. If it's not the same and it should be, contact us to rectify this issue. If it's not the same, please only use your own license key and don't pass your license keys around.

License key FAQs

How do I check if my key has been loaded correctly?

For the core iText library, the license is only checked when you load it. If you loaded the license key and there was no exception thrown, then it loaded correctly. The add-ons, however, will regularly check the license key. If there is an issue with your license key, the library will throw a LicenseKeyException.

If you want to check the license key manually, you can call the following method:

LicenseKey.scheduledCheck(null);

 

This will throw a LicenseKeyException when the key is invalid or corrupt.

LicenseKey.ScheduledCheck(null);

 

Contact

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now