Search code examples
fontsjasper-reportssubreportexport-to-pdf

Font embedded in main jasperreport but not in subreport when exporting to PDF


When previewing my report in jasper studio everything looks fine, both mainreport and subreports use the correct font.

Whenever I export the report to pdf it only displays the correct font in my main report and my header subreport. The footer subreport is using the standard font. The title in my footersubreport are also not displayed in bold. Not even in bold using the standard pdf font.

I added the font to jasper studio -> preferences -> font select all .ttf files and checked embed in pdf.

I also tried adding the isPdfEmbedded="true property, this only gives a deprecaded warning but does not change the output.

any thoughts?


Solution

  • I managed to solve this problem; Here is what I did:

    Backup your project somewhere safe.
    Remove project from jasper.
    Remove previously installed fonts (Window -> preferences -> Jasper Studio -> fonts)
    Delete JasperSoft Studio
    Reinstall jasperSoftStudio
    open previously backed up project again in JasperSoft Studio
    Rebuild project
    Change textfields to a font that is always embeded in pfd (sans serif or somehitng)
    Export report to PDF
    See if Bold text appears
    Change back to custom font and export again

    This did the trick for me. Changing fonts before I reinstalled did not work, only after I reinstalled Jasper. Also dont forget to delete custom fonts before deleting JasperSoft Studio, for some reason they appeared again after the fresh installation and it did not work.