0

I am newbie in Java and DynamicReports. I am trying to export some data to PDF with DynamicReports using JasperReports. The problem is that my text contains unicode characters that are not in DejaVuSans. I have read DynamicReport documentation about adding fonts (dynamicreports.org/documentation/fonts), but I can not edid none of files mentioned in fonts page. I am using NetBeans and Java Maven project. All files in JasperReportsFont dependency are write-protected. Is there any option to export with unicode characters? JaspierViewer shows all characters, but after export they are gone.

4

1 回答 1

0

我如何解决我的问题:我已阅读http://rekowski.info/home/technical/java/embedded-fonts-with-jasperreports-and-maven.xml已 下载 iReport 5.6.0 和 java jdk 1.7... 我有阅读了很多帖子,所有解决方案对 win 10 都没有帮助。所以我改变了 java jdk 1.7 的路径(比如iReport 没有开始使用 JRE 8)。使用 iReport 创建字体 jar,我在其中使用 windows 字体 times.ttf。选择您需要的 PDF 编码。以我的方式,我选择了 Cp1257,但我相信它可以与 Identity-H 一起使用。将字体导出到 jar 文件。然后我已将 jar 文件导入 maven(youtube - 如何将 JAR 文件添加到本地 Maven 存储库?:javavids)并将依赖项添加到我的 POM 文件中。在我的 java 项目文件中,我有 .setFontName("my font name") 来设置样式,我在 DynamicReports/Jasperreports 报告中使用它。我希望你能理解我在这里写的这个烂摊子:) 如果你对这个解决方案有任何疑问,请询问。

于 2016-05-15T11:35:36.357 回答