Note that "Arial" parameter in FontKey method points to the iReport "Font Name" field (although the font added is actually "ARIAL.TTF") - so when designing the report, you have to choose "ARIAL.TTF" as "PDF Font Name" and "Arial" as "Font Name"!!! this is very important cause for some reason, at run time, Jasper engine searches for the TTF font by the key of "Arial". JRPdfExporter exporter = new JRPdfExporter() ĮtParameter(JRPdfExporterParameter.CHARACTER_ENCODING, "UTF-8") ĮtParameter(JRPdfExporterParameter.FONT_MAP, fontMap) PdfFont font = new PdfFont("(fontPath)\\ARIAL.TTF",BaseFont.IDENTITY_H,true) //(String pdfFontName, String pdfEncoding, Boolean isPdfEmbedded) Then, I've added this code that adds the desired font at runtime:įontKey key = new FontKey("Arial", false, false) //(String fontName, Boolean bold, Boolean italic) (the jar that came with the jasperReports download was older) ![]() ![]() First of all, I've updated the iText jar and src files to the latest (1.4.8)
0 Comments
Leave a Reply. |