我使用的JasperReport版本6.2如何在导出为PDF时获得非英语支持?
我想报表导出为PDF格式,但我的报告将不支持的语言不同,那么英语(其它语言字段显示为空白),
这是我的生成代码报告
JsonDataSource ds = new JsonDataSource(JRLoader.getInputStream(jsonFile));
JasperReport jasperReport = (JasperReport) JRLoader.loadObject(jasperFile);
parameters.put(JRParameter.REPORT_FILE_RESOLVER, new SimpleFileResolver(new File(reportDirPath)));
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, ds);
JasperExportManager.exportReportToPdfFile(jasperPrint, outputFilePath);
我创建了一个字体扩展使用本教程: “http://community.jaspersoft.com/wiki/custom-font-font-extension”
导出至JAR文件,并添加到我的项目类路径,但并非所有英文领域仍是空白
彼得与此 link评论是非常有益的,它帮助我意识到,如果我的字体支持首先
考虑,以测试你直接在字体pdf http://stackoverflow.com/questions/35127956/how-can-i-test-if-my-font-is-rendered-correctly-in-pdf并检查此[检查列表](http:// stackoverflow。 com/questions/34287186/jasper-report-hindi-pdf/34287509#34287509) –
让我知道你是否被卡住了 –
@PetterFriberg嘿,链接中提供的例子非常有帮助(第一个链接),我注意到open sans不支持希伯来语,我决定使用google noto(https://www.google.com/get/noto/)。我需要动态地支持5种语言,这意味着像6种字体,我应该加载6个'字体扩展'的jar包到类路径中,这将如何工作?谢谢 –