Jump to content
  • PDF-preview with embedded fonts in Jasperstudio >= v6.8.0


    franky4
    CategoryBug report
    PriorityHigh
    ReproducibilityAlways
    ResolutionFixed
    SeverityMinor
    StatusResolved

    We use font extension and include the jar-file in the Java build path for some reports to embedd the font in PDF-files finally.

    Since Jaspersoft Studio 6.8.0 (CE) the PDF-preview of reports within the studio(!) does't work anymore, java-preview still works.

    Using Studio 6.6.0 (CE) with the same workspace still works, too.

     

    The error message tells the font could not be loaded, but it exist, and works <= studio 6.6.0 (CE).


    Attachments:

    User Feedback

    Recommended Comments

    The bug still exists in Jaspersoft Studio 6.10.0 (CE):

     

    net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font:

    pdfFontName: fonts/Tahoma_PDF/tahoma.ttf

    pdfEncoding: Cp1251

    isPdfEmbedded : true

    at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:2549)

    at net.sf.jasperreports.engine.export.JRPdfExporter.getChunk(JRPdfExporter.java:2332)

    at net.sf.jasperreports.engine.export.JRPdfExporter.getPhrase(JRPdfExporter.java:2301)

    at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.getPhrase(SimplePdfTextRenderer.java:64)

    at net.sf.jasperreports.engine.export.SimplePdfTextRenderer.render(SimplePdfTextRenderer.java:73)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2662)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:1104)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:1063)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:927)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:547)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction.exportWithProgress(AExportAction.java:223)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction.doPreview(AExportAction.java:347)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction$3.run(AExportAction.java:191)

    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

     

    Link to comment
    Share on other sites

    Hi,

     

    Are you running these reports only from within JSS, or do you actually deploy them into a different application in production? If you do have a different report generating application in production, do you experience this problem when upgrading JRL there?

     

    Thanks,

    Teodor

    Link to comment
    Share on other sites

    The problem exists only within Jaspersoft Studio > 6.6.0 (pdf-preview and -export). The final reports work fine in out own application

    with the library 6.4.0 or 6.9.0. So it seems to be a problem with the studio. I attached a simple jar which is in the java class path

    (listed under References Libraries).

    If I choose that font (tahoma) I get the error (and an empty pdf opens), if I use sans serif (default) the pdf-preview works.

    By the way, the problem still exists in the current version 6.11.0.

    Link to comment
    Share on other sites

    Changed Assigned User from @teodord to -


    I can confirm it happens with jaspersoft studio > 6.6.0 (it works in 6.6.0 and fails on 6.8.0 and hihger including latest 6.11.0). We use jasperreport library to generate our reports and it works, I'll check tomorrow the version (I think we are currently using 6.8.0 but not sure)I've attached a sample project with a sample font extension and a sample jrxml report (only a static text using the only font in the font-extension).Step to reproduce:Import the project in jaspersoft studio >= 6.8.0.Open the reoport Blank_A4.jrxmlClick no preview tabSelect "PDF" on the exporter drop down.the error alert popups and de pdf viewer opens with the incomplete pdf (blank in this examples, in real life pdfs the pdf is generated until the font extension is used)In jasspersoft studio 6.6.0 and lower works as expected: the pdf is generated and previewed with the desired font : not empty pdf, not error message.I've done some research and it seems that the font extensions is registered but the jar itself is not registered in a RepositoryService
    Link to comment
    Share on other sites

    I've reviewed the versions we use:

    - jasperreports librrary 6.8.0 works

    - Jaspersoft Studio <= 6.6.0 and Eclipse plugin <= 6.6.0 works

    - Jaspersoft Studio >= 6.8.0 and Eclipse plugion >= 6.8.0 fails

    Link to comment
    Share on other sites

    I can also confirm that the PDF-preview ist fixed. Nevertheless, the Export to PDF still has the same error (see image), and the file is generated but empty (see attachment).
    Link to comment
    Share on other sites

    I have exactly the same problem in latest JasperSoft Studio 6.17.0:

     

    net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font:

    pdfFontName: fonts/Mplus1p/MPLUS1p-Regular.ttf

    pdfEncoding: Identity-H

    isPdfEmbedded : true

    at net.sf.jasperreports.engine.export.JRPdfExporter.setFont(JRPdfExporter.java:2548)

    at net.sf.jasperreports.engine.export.JRPdfExporter$1.setFont(JRPdfExporter.java:792)

    at net.sf.jasperreports.export.pdf.classic.ClassicPdfProducer.getFont(ClassicPdfProducer.java:376)

    at net.sf.jasperreports.export.pdf.classic.ClassicPdfProducer.createChunk(ClassicPdfProducer.java:384)

    at net.sf.jasperreports.engine.export.JRPdfExporter.writePageAnchor(JRPdfExporter.java:1066)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:1015)

    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:673)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction.exportWithProgress(AExportAction.java:217)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction.doPreview(AExportAction.java:340)

    at com.jaspersoft.studio.editor.preview.actions.export.AExportAction$3.run(AExportAction.java:188)

    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

     

    Link to comment
    Share on other sites


×
×
  • Create New...