You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using JasperReports with OpenPDF, I can not generate PDF report with embedded arial font:
net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font:
pdfFontName: arialbd.ttf
pdfEncoding: Cp1252
isPdfEmbedded : true
at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:2335)
I notice, in the constructor of the com.lowagie.text.Document.RandomAccessFileOrArray class, the line: File file = new File(filename);
fileName is in my case "arialbd.ttf" and not the full path name?
So It search in the current directory...
Before generating the jasper report, I call this line: FontFactory.registerDirectories();
To fix my issue, I think the RandomAccessFileOrArray constructor must also search in all registered directories if filename is not a full path name.
In my case, the arialbd.ttf file can be found in C:\windows\fonts.
This kind of modification could not cause any regression.
Or at worst, we need a property to set the default font search folder to use in this class if filename is not a full path name.
The text was updated successfully, but these errors were encountered:
Using JasperReports with OpenPDF, I can not generate PDF report with embedded arial font:
I notice, in the constructor of the com.lowagie.text.Document.RandomAccessFileOrArray class, the line:
File file = new File(filename);
fileName is in my case "arialbd.ttf" and not the full path name?
So It search in the current directory...
Before generating the jasper report, I call this line:
FontFactory.registerDirectories();
To fix my issue, I think the RandomAccessFileOrArray constructor must also search in all registered directories if filename is not a full path name.
In my case, the arialbd.ttf file can be found in C:\windows\fonts.
This kind of modification could not cause any regression.
Or at worst, we need a property to set the default font search folder to use in this class if filename is not a full path name.
The text was updated successfully, but these errors were encountered: