sskotnicky Posted April 3, 2019 Share Posted April 3, 2019 Anytime I try to export a report to PDF I get this exception.Could not initialize class net.sf.jasperreports.engine.export.PdfGlyphRendererAny 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. Link to comment Share on other sites More sharing options...
Friendly User Posted April 4, 2019 Share Posted April 4, 2019 I have never seen this error before, could you post more exception text? Have you tried to add -Djava.awt.headless=true to your JAVA_OPTS? Link to comment Share on other sites More sharing options...
hozawa Posted April 5, 2019 Share Posted April 5, 2019 Are you using JasperReports IO as you've tagged your question or are you actually writing your own program using JasperReports library. If the later, check that you haven't specified itext dependency beside the one jasperreports comes bundled with. Link to comment Share on other sites More sharing options...
sskotnicky Posted April 8, 2019 Author Share Posted April 8, 2019 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) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now