[#12131] - PDF-preview with embedded fonts in Jasperstudio >= v6.8.0

Category:
Bug report
Priority:
High
Status:
Resolved
Project: Severity:
Minor
Resolution:
Fixed
Component: Reproducibility:
Always
Assigned to:
1

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).

franky4's picture
46
Joined: Jan 5 2016 - 2:15am
Last seen: 1 day 15 hours ago

11 Comments:

#1

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)

#2
#3
  • Assigned:nobody» teodord
#4

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

#5
  • Status:New» Feedback Requested
#6

Also, can you attache here the font extension JAR?

#7

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.

AttachmentSize
File tahoma-pdf.jar784.54 KB
#8
  • Assigned:nobody»

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.jrxml
Click no preview tab
Select "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

AttachmentSize
Package icon myreports.zip651.61 KB
#9

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

#10
  • Resolution:Open» Fixed
  • Status:Feedback Requested» Resolved
  • Assigned:nobody» chicuslavic

Thank you for your sample!

#11

Thanks a lot!

where can I get the fixed (open/nigthly) version of the Studio,
or do I have to wait for the next released version?

Franky

Feedback
randomness