Anytime I try to export a report to PDF I get this exception.
Could not initialize class net.sf.jasperreports.engine.export.PdfGlyphRenderer
Any idea, what is causing this and how to fix this?
Btw: I've tried JasperExportManager.exportReportToPdfFile, JasperExportManager.exportReportToPdfStream methods and also creating a JRPdfExporter settings input and output and then calling the exportReport method. I get the same exception all the time.
3 Answers:
Thank you very much for the reply.
I am writing a method that gets the JasperReport and exports it to HTML / PDF, because the preview generated has some problems with the arabic font . Export to PDF throws this exception and export to HTML work almost OK. It generates the HTML correctly, but when I print it (or export to PDF), co covers only (around) 80% of page. (I can give you more details if you want).
Here is the whole stact trace:
2019-04-08 09:13:38.130 23 LogTopic.Desktop.DESKTOP ERROR Uncaught exception {EXCEPTION}
java.lang.NoClassDefFoundError: com/lowagie/text/pdf/PdfContentByte
at net.sf.jasperreports.engine.export.PdfGlyphRenderer.determinePatchedItext(PdfGlyphRenderer.java:59)
at net.sf.jasperreports.engine.export.PdfGlyphRenderer.<clinit>(PdfGlyphRenderer.java:52)
at net.sf.jasperreports.engine.export.JRPdfExporter.initExport(JRPdfExporter.java:580)
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:539)
at net.sf.jasperreports.engine.JasperExportManager.exportToPdfFile(JasperExportManager.java:155)
at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:503)
at octopus.client.print.PrintPreviewDialog.generatePreview(PrintPreviewDialog.java:520)