Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace dependency com.lowagie:itext:2.1.7 with OpenPDF latest version #634

Open
stefan-dan opened this issue Feb 18, 2024 · 2 comments
Open

Comments

@stefan-dan
Copy link

Hello there,

I'm using this XWPF convertor to convert .doc files to .pdf.

The latest version 2.0.4 is using this vulnerable dependency: com.lowage:itext:2.1.7.

I'm also using JasperReports, which recently switch from iText 2.1.7 to LibrePDF/OpenPDF.

Because I'm using both XWPF convertor and JasperReports, there is a clash between the dependencies and I have to exclude com.lowage:itext:2.1.7 dependency.

Are there any plans for XWPF convertor to switch to OpenPDF?

@BishopWolf
Copy link

BishopWolf commented Mar 12, 2024

I am getting this error because of this issue

WARNING: Illegal reflective access by com.lowagie.text.pdf.MappedRandomAccessFile$1 (file:/~/.m2/repository/com/lowagie/itext/2.1.7/itext-2.1.7.jar) to method java.nio.DirectByteBuffer.cleaner()

Is there any way to circunvent it?

@stefan-dan
Copy link
Author

@BishopWolf try this workaround.

Otherwise try to exclude the com.lowagie dependecy, here is an example using Gradle:

implementation 'fr.opensagres.xdocreport:fr.opensagres.poi.xwpf.converter.pdf:2.0.4', { exclude group: 'com.lowagie' }

and then add the OpenPDF dependency:

implementation 'com.github.librepdf:openpdf:2.0.1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants