I've an application where I use jasper reports libraries for generating report from online. Whatever font I use other than Helvetica, to generate a pdf report, is a problem. I'm not able to detect from where the font is referred/loaded. I dont have any explicit classes for either Helvetica or Times-Roman.
Following is the error thrown:
net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font :
pdfFontName : Times-Roman
pdfEncoding : Identity-H
isPdfEmbedded : false
at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:2036) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:1818) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:1787) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.getPhrase(SimplePdfTextRenderer.java:89) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.render(SimplePdfTextRenderer.java:99) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2158) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:861) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:821) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:698) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:420) ~[jasperreports-5.5.0.jar:5.5.0]
But for the same report if I give PDF font name as Helvetica, everything runs fine.
Can anybody please help me understand how this works ? Also, If I want to add some new font, where can I add it ?
Followed the steps to add a new font in jasper fonts jar , mentioned in below link
http://www.codesuggestions.com/java/jasper-reports/adding-custom-fonts-t...
Earlier error vanished. A new error popped up.
Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:121) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:88) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:103) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:61) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:179) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:81) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:276) ~[jasperreports-5.5.0.jar:5.5.0]
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:745) ~[jasperreports-5.5.0.jar:5.5.0]
jasperreports-5.5.0.jar is present in the classspath of the application, still facing this error.