[#5001] - Bad PDF export of text in Kurdish language

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

The export of text in Kurdish language results in slightly changed text.
Please find attached sample report and exported PDF.
Third character from the left is not the same in JasperSoft Studio Preview and in the generated PDF.

AttachmentSize
Package icon Ignore this file15.53 KB
Package icon kurdish_report_and_pdf.zip15.71 KB
v6.1.0
zranisavljevic's picture
Joined: Jul 24 2014 - 3:18am
Last seen: 5 years 7 months ago

5 Comments:

#1

Just to add that this issue is critical in a project I am working on.
I'd really appreciate if this is taken under consideration by the developers.
Thanks.

#2

iText (the library used by JasperReports for PDF exporting) supports Arabic ligatures. But that only partially covers Kurdish. In your text, the problem is with the U+06CE character, which is specific to Kurdish (if I understand correctly). iText does not know that it needs to create a ligature using that character.

We've been aware of similar limitations of the iText library. There are no easy ways to address the limitations unfortunately. We do have a couple of ideas that we could try, but for the moment we haven't yet established the feasibility of a solution. Doing that will take more time.

Regards,
Lucian

#3
  • Resolution:Open» Fixed
  • Status:New» Resolved

We implemented a solution that uses AWT (which JasperReports already uses in other contexts) to layout texts to glyph vectors, and then directly writes the glyphs to PDF. This assumes that the AWT font as resolved by JR is identical to the PDF font. We recommend using font extensions to ensure that the AWT and PDF fonts are the same. Also, only PDF embedded fonts with IDENTITY-H encoding are supported.

The JR code changes are at
https://sourceforge.net/p/jasperreports/code/ci/cc07dc5a65a6748ca75f4ae7...
https://sourceforge.net/p/jasperreports/code/ci/5f2f9dbf6b3bcfe1a469b421...

The solution can be tested by fetching a JR jar from http://jaspersoft.artifactoryonline.com/jaspersoft/jr-ce-snapshots/net/s...

It has a dependency on a patched iText jar that can be found at http://jasperreports.sourceforge.net/maven2/com/lowagie/itext/2.1.7.js4-...

For the fix to apply to Kurdish, the following property should be added to jasperreports.properties (or set in the report):
net.sf.jasperreports.export.pdf.glyph.renderer.blocks.arabic=arabic

Regards,
Lucian

#4

New solution is implemented and successfully tested.

Thank you very much!

#5

adding this line of code to the report saved me days of work:
<property name="net.sf.jasperreports.export.pdf.glyph.renderer.blocks.arabic" value="arabic"/>

Thanks a million!.

Feedback