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

NoSuchMethodError: ...Document.setGlyphSubstitutionEnabled #350

Closed
Sab3rRid3r opened this issue Apr 24, 2023 · 7 comments
Closed

NoSuchMethodError: ...Document.setGlyphSubstitutionEnabled #350

Sab3rRid3r opened this issue Apr 24, 2023 · 7 comments

Comments

@Sab3rRid3r
Copy link

Hi, with the change to jasperreports:6.20.1 and openpdf:1.3.30 instead of itext:2.1.7 we hat no problems so far.
Today we tried jasperreports:6.20.3 an got the following Exception:

java.lang.NoSuchMethodError: 'void com.lowagie.text.Document.setGlyphSubstitutionEnabled(boolean)'
at net.sf.jasperreports.export.pdf.classic.ClassicPdfProducer.createDocument(ClassicPdfProducer.java:128)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:835)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:685)
at net.sf.jasperreports.engine.JasperExportManager.exportToPdfStream(JasperExportManager.java:196)
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfStream(JasperExportManager.java:533)

We use springboot 2.7.10 with Java 17 and XML as Datasource.
Thanks in advance
Andreas

@teodord
Copy link
Collaborator

teodord commented Apr 25, 2023

You need to add this repository to your pom.xml files:
https://github.com/TIBCOSoftware/jasperreports/blob/master/jasperreports/pom-parent.xml#L100
and make use of this custom version of OpenPDF, at least until our contributions gets accepted into their official release:
https://github.com/TIBCOSoftware/jasperreports/blob/master/jasperreports/pom.xml#L68

I hope this helps.
Teodor

@yu-shiba
Copy link

LibrePDF/OpenPDF#904

@teodord
Copy link
Collaborator

teodord commented May 2, 2023

The release 6.20.4 was published to put back mandatory OpenPDF dependency in pom.xml.

@teodord teodord closed this as completed May 2, 2023
@Sab3rRid3r
Copy link
Author

With jasperreports:6.20.4 & openpdf:1.3.30 I still get the same NoSuchMethodError Exception. Plz reopen.

@teodord
Copy link
Collaborator

teodord commented May 2, 2023

Is there any particular reason for which you insist on using OpenPDF 1.3.30 instead the one I mentioned you in my first reply above?
If you do not want to change the version of OpenPDF, as recommended, why would you change the version of JasperReports then?

@Sab3rRid3r
Copy link
Author

Sorry, I forgot to mention that we can't use the 1.3.30.jaspersoft.2 because the buildprocess of our application gets the dependencies from mvnrepository: com.github.librepdfhttps://mvnrepository.com/artifact/com.github.librepdf/openpdf and 1.3.30 is the latest official version.
I thought with jasperreports:6.20.4 the access to Document.setGlyphSubstitutionEnabled is removed, which I guess I was wrong about. So it would be interesting to know at which version jasper starts working again with official published dependencies.
The reason for updating jasper is because the renovate bot found the new version and we try to stay up to data and find bugs as early as possible.

@dadza dadza reopened this May 5, 2023
@dadza dadza closed this as completed in 20fc69a May 5, 2023
@dadza
Copy link
Collaborator

dadza commented May 5, 2023

The upcoming JasperReports release (6.20.5) will work with the standard/unpatched OpenPDF 1.3.30.

Note that if you also have Apache FOP on your application's classpath you'll have to explicitly set the net.sf.jasperreports.export.pdf.classic.fop.glyph.substitution.enabled property to true, disabling FOP based glyph substitution requires the patched OpenPDF version.

Once LibrePDF/OpenPDF#765 and LibrePDF/OpenPDF#904 are accepted by OpenPDF we'll no longer need to patch OpenPDF.

Regards,
Lucian

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

4 participants