Can we use the latest JasperReports (6.20.0) with itextpdf (5.5.13.3) to generate pdf reports in a Spring Boot project

Hello, I would like to ask if there is a way to use the latest JasperReport Library to create a pdf in a Spring Boot project.

maven repohttps://mvnrepository.com/artifact/net.sf.jasperreports/jasperreports/6....

I have noticed that the version 6.20.0 does not have the following dependency

 

In order to fix this error, I had to set the dependencies in the POM file, as follows:

<dependency>
    <groupId>net.sf.jasperreports</groupId>
    <artifactId>jasperreports</artifactId>
    <version>6.20.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.lowagie</groupId>
            <artifactId>itext</artifactId>
        </exclusion>
    </exclusions>
</dependency>
 
<dependency>
    <groupId>com.lowagie</groupId>
    <artifactId>itext</artifactId>
    <version>2.1.7</version>
    <scope>compile</scope>
</dependency>

As you can see above, I had to use an older version of itext 2.1.7

Furthermore, itext has moved to itextpdf.

Assume that I would like to use the latest versions of JasperReports (6.20.0) and itextpdf (5.5.13.3). As soon as I try to generate the pdf file, I get the following error:

Caused by: java.lang.ClassNotFoundException: com.lowagie.text.DocumentException

I read in this thread, that I have to use itext 2.1.7: https://community.jaspersoft.com/questions/986581/jasperreports-621-clas...

Is there a possibility that this issue could be fixed in the future?

Thank you in advance!

fiyov46807's picture
Joined: Apr 28 2020 - 12:01am
Last seen: 4 days 6 hours ago

1 Answer:

Jaspersoft created the github repo https://github.com/Jaspersoft/jasperreports-pdf-lib7 for this.

 

jgust's picture
2606
Joined: Jun 10 2010 - 6:39am
Last seen: 18 min 24 sec ago
Feedback