Installing iText for Java
How to install iText Java version
Thank you for your interest in our open-source 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, whether you use a build automation tool, such as Maven, or you want to download the JAR files directly.
If you require any extra help please have a look at our FAQs or the community discussion at StackOverflow. 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.
Before you install (commercial license users only)
Make sure you have purchased a commercial license for iText. All downloads we offer closed-source come with our commercial license model.
Download and install the proper license key library, you can find the installation guide here.
Installation
Using the Central Repository
iText Core is available via Maven on The Central repository. You will need to choose whether you want to add all modules or just the ones you require.
Adding all modules
If you need all iText modules, then you don't need to add the individual modules and you can just add this XML snippet in your pom.xml
. Maven will then do all the heavy lifting for you and download the required modules from The Central Repository. Simply add iText as a dependency to your pom.xml
:
<properties>
<itext.version>8.0.5</itext.version>
</properties>
<dependencies>
<!-- add all iText modules -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itext-core</artifactId>
<version>${itext.version}</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>bouncy-castle-adapter</artifactId>
<version>${itext.version}</version>
</dependency>
</dependencies>
Adding only the modules you need
If you do not require some of the functionality in iText, then you can add only the modules you need. Please be aware you will always need kernel
, io
and layout
. You will need to add the following XML snippets to your pom.xml
. Simply add iText as a dependency to your pom.xml
.
<properties>
<itext.version>8.0.5</itext.version>
</properties>
<dependencies>
<!-- always needed -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>kernel</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- always needed -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>io</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- always needed -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>layout</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- always needed -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>bouncy-castle-adapter</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- only needed for forms -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>forms</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- only needed for PDF/A -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>pdfa</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- only needed for PDF/UA -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>pdfua</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- only needed for digital signatures -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>sign</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- only needed for barcodes -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>barcodes</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- only needed for Asian fonts -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>font-asian</artifactId>
<version>${itext.version}</version>
</dependency>
<!-- only needed for hyphenation -->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>hyph</artifactId>
<version>${itext.version}</version>
</dependency>
</dependencies>
Using sign functionality
All the necessary bouncy-castle related classes are grouped into two modules: bouncy-castle-adapter
and bouncy-castle-fips-adapter
.
One of these modules is required to be in a classpath, although only bouncy-castle-adapter
is used in the examples above.
It is important not to add them both as a dependency since they are not compatible.
com.itextpdf:bouncy-castle-adapter
maven module encapsulates bouncy-castle related classes for these two maven dependencies:
org.bouncycastle:bcpkix-jdk15on
org.bouncycastle:bcprov-jdk15on
com.itextpdf:bouncy-castle-fips-adapter
maven module encapsulates bouncy-castle related classes for these two maven dependencies:
org.bouncycastle:bcpkix-fips
org.bouncycastle:bc-fips
you can read more about it here.
Using the iText Artifactory Server
iText is also available on the iText Artifactory server. Here you can also find the license key library and closed-source add-ons - you require an additional license key for each of these add-ons.
You can add this server as an additional Maven repository in the repositories section of your pom.xml
, as described in the Maven documentation. Maven will then automatically query this repository for the add-on .jar files.
Add the repository to your pom.xml
:
<!-- All add-ons and iText Core-->
<repositories>
<repository>
<id>itext-releases</id>
<name>iText Repository - releases</name>
<url>https://repo.itextsupport.com/releases</url>
</repository>
</repositories>
Downloading the files manually
You can download the jar files directly from our GitHub repository or from our Artifactory server.
After Installation
Check out the Java jump-start tutorial and helpful code examples here on the Knowledge Base, or you can find our API documentation in the Resources section of our website.
iText Java on GitHub
The source code is available on GitHub.
Installing SNAPSHOT builds
During development, we release SNAPSHOT builds which you can install if you require a fix for a specific issue, before it is made available on an official RELEASE. Snapshots can be downloaded from the iText Artifactory and are appended with a -SNAPSHOT
suffix.
Our SNAPSHOT builds pass the same quality control as RELEASE versions. We don't introduce breaking changes between minor releases (0.0.x
), so the main difference from a RELEASE
version is that a SNAPSHOT
version will be continually updated and includes all the fixes and improvements introduced since the latest release.
To fetch the snapshot using Maven add the snapshot server as an additional Maven repository in the repositories section of your pom.xml
:
<repositories>
<repository>
<id>itext-snapshot</id>
<name>iText Repository - snapshots</name>
<url>https://repo.itextsupport.com/snapshot</url>
</repository>
</repositories>
NOTE: If you’ve previously installed a SNAPSHOT build you may need to clear your local cache. In Maven you can run mvn dependency:purge-local-repository clean
from the command line.
Alternatively, you can browse the iText Artifactory snapshot directory if you want to manually download the .jar
file.
Adding our iText add-ons
If you would like to add one of our add-ons, please first have a look at the compatibility matrix and the installation guides of each of these add-ons.