Search code examples
javajasper-reportsmigration

How to upgrade 3.x code to 6.3.0 since it is missing FontKey and PdfFont


We have migrated to Java 8 and we need to move from v3.5.2 of JasperReports jar to v6.3.0.

In the code we are using FontKey and PdfFont classes, which do not seem to present in the updated jar. Any solution?


Solution

  • They both where first deprecated (I saw them last in version 5.5.1) and are now removed from JasperReports library.

    The solution is to revert back to 5.5.1 or even better to not use them anymore, change your code accordingly. The documentation points to FontFamily.getExportFont(java.lang.String).

    Note: In newer versions of jasper-reports you should use font-extensions, to include and display correctly fonts when exporting to pdf.