iText latest Maven dependency

2019-01-25 07:18发布

问题:

What is the latest version of iText? And what is the maven dependency for that?

回答1:

You need to pay attention to the license for the Java version of iText:

  • iText 2.1.7: the latest official release by iText Group NV, under the MPL & GPL license, with com.lowagie groupId;
  • iText 4.2.1: the latest unofficial release by ymasory/InProTopia, under the MPL & GPL license, with com.lowagie groupId;
  • iText 5.0.0 and higher: released by iText Group NV, under the AGPL license, with com.itextpdf groupId. One monolithic jar.
  • iText 7.0.0 and higher: released by iText Group NV, under the AGPL license, with com.itextpdf groupId. Several modular jars.

Here you can find 2.1.7 and 4.2.x versions on Maven Repository:

Find before 5.x versions: http://search.maven.org/#search|gav|1|g%3A%22com.lowagie%22%20AND%20a%3A%22itext%22

Find 5.x versions: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.itextpdf%22%20AND%20a%3A%22itextpdf%22

You may want to stick with the MPL & GPL versions, unless you are available to follow the AGPL license specification...

EDIT: You should pay attention on which version you are choosing;

According to Bruno Lowagie comment, versions 2.1.x are deprecated and should not be used due to technical and legal reasons.



回答2:

looks like 5.3.5 is not in repository yet so 5.3.4 works for me:

<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itextpdf</artifactId>
    <version>5.3.4</version>
</dependency>


回答3:

As with many (any?) open-source library, their website contains a changelog. iText's one can be found here.

And as of today, the latest version is 5.5.9 7.0.0.

The dependency for version 5.5.9 would be

<dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>itextpdf</artifactId>
    <version>5.5.9</version>
</dependency>


回答4:

iText 7 was released in May 2016. iText 7 is no longer one monolithic jar file, like iText 5 used to be. You use only those modules you need.

Put this in your POM file:

<dependencies>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>barcodes</artifactId>
    <version>7.0.0</version>
    <!-- barcodes depends on kernel -->
  </dependency>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>font-asian</artifactId>
    <version>7.0.0</version>
  </dependency>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>forms</artifactId>
    <version>7.0.0</version>
    <!-- forms depends on kernel and layout -->
  </dependency>

  <dependency>
      <groupId>com.itextpdf</groupId>
      <artifactId>hyph</artifactId>
      <version>7.0.0</version>
  </dependency>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>io</artifactId>
    <version>7.0.0</version>
  </dependency>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>kernel</artifactId>
    <version>7.0.0</version>
    <!-- kernel depends on io -->
  </dependency>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>layout</artifactId>
    <version>7.0.0</version>
    <!-- layout depends on kernel -->
  </dependency>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>pdfa</artifactId>
    <version>7.0.0</version>
    <!-- pdfa depends on kernel -->
  </dependency>

  <dependency>
    <groupId>com.itextpdf</groupId>
    <artifactId>sign</artifactId>
    <version>7.0.0</version>
    <!-- sign depends on kernel, layout and forms -->
  </dependency>

</dependencies>

This, and more information, can be found on https://developers.itextpdf.com/itext-7-java



回答5:

This was the latest release as of today

<!-- http://mvnrepository.com/artifact/com.itextpdf/itextpdf -->

<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.5.9</version>
</dependency>