You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Gujarati Text Not Rendering Correctly in JasperReports PDF Output #561
Gujarati text is not rendered correctly in PDFs generated using JasperReports, even though the font is properly embedded and Unicode encoding is used.
The generated PDF shows broken or incorrectly shaped Gujarati characters (matras and ligatures), while the same text renders perfectly in browsers or other PDF generators.
Observations:
pdffonts confirms the font is embedded correctly (CID TrueType, Identity-H)
Font used: Anek Gujarati (Unicode)
Issue persists across multiple JasperReports versions (6.20.x / 6.21.x)
The same text renders correctly when generated via HTML → PDF or image-based rendering
This indicates a limitation in JasperReports' text rendering (Java2D) for complex Indic scripts.
I ran the Unicode sample report from the JasperReports repository as suggested.
As you can see in the attached screenshot, the Gujarati text is not rendering correctly in the generated PDF — it appears as square boxes. This happens specifically for Gujarati, while other languages (like Hindi, Marathi, Tamil, etc.) are rendered properly.
So even in the official sample report, the issue persists for Gujarati when using the current font setup. This further indicates that the problem is related to how the Gujarati font (such as Anek Gujarati) is being embedded or handled during PDF generation.
Characters appear distorted or improperly joined, even though other Gujarati fonts work fine. This issue occurs only with the Anek Gujarati font during PDF export
I’m unable to attach the TTF file here so I converted the ttf as txt and sent you, and the font used is Anek Gujarati. The issue occurs specifically with this font during PDF generation.
The Gujarati text “સુરેશ જુકેસ” is written correctly and renders properly in preview as well as when using other Gujarati fonts.
However, when the Anek Gujarati font is used, the generated PDF visually renders the text incorrectly, appearing as “સરુશે, જકુસે”.
Interestingly, when the text is copied from the PDF or extracted using any AI/text tool, it is read and written correctly as “સુરેશ જુકેસ”.
This clearly indicates that the issue is not with the actual text data or Unicode encoding, but only with the visual rendering of the Anek Gujarati font in the PDF output.
JasperReports depends on the forked OpenPDF version at the moment. For the future we will create a pull request so that the fix gets into the official OpenPDF code.
@dadza please don't forget to provide upstream PR's to OpenLibre as this has broken Quarkus JasperReports because GRaalVM cannot find that method in the custom JAR we are using an official Quarkus OpenLibre jar.
Activity
dadza commentedon Dec 28, 2025
There's a Unicode sample report in the JasperReports sources that includes Gujarati text rendered with the Noto Sans Gujarati font. See at https://github.com/Jaspersoft/jasperreports/tree/74d586df47b25dbd05bd0957999819196e59934a/jasperreports/demo/samples/unicode
Can you run that sample report and check the Gujarati text in the PDF output?
Thank you,
Lucian
jayeshsony commentedon Dec 29, 2025
Hi Lucian,
I ran the Unicode sample report from the JasperReports repository as suggested.
As you can see in the attached screenshot, the Gujarati text is not rendering correctly in the generated PDF — it appears as square boxes. This happens specifically for Gujarati, while other languages (like Hindi, Marathi, Tamil, etc.) are rendered properly.
So even in the official sample report, the issue persists for Gujarati when using the current font setup. This further indicates that the problem is related to how the Gujarati font (such as Anek Gujarati) is being embedded or handled during PDF generation.
Thanks,
Jayesh
dadza commentedon Dec 29, 2025
Please share a report (and PDF output) to reproduce the issue that you're experiencing.
jayeshsony commentedon Dec 29, 2025
font_issue_jrxml_code.txt
font_issue.pdf
Characters appear distorted or improperly joined, even though other Gujarati fonts work fine. This issue occurs only with the Anek Gujarati font during PDF export
I’m unable to attach the TTF file here so I converted the ttf as txt and sent you, and the font used is Anek Gujarati. The issue occurs specifically with this font during PDF generation.
anek-gujarati.txt
dadza commentedon Dec 30, 2025
Please attach a minimal and self contained sample report that can be used to reproduce the issue.
jayeshsony commentedon Jan 2, 2026
Anek.txt
dadza commentedon Jan 2, 2026
Thank you.
Can you also please attach the PDF output that you are getting and explain what is wrong with it and what the expected result?
jayeshsony commentedon Jan 6, 2026
The Gujarati text “સુરેશ જુકેસ” is written correctly and renders properly in preview as well as when using other Gujarati fonts.
However, when the Anek Gujarati font is used, the generated PDF visually renders the text incorrectly, appearing as “સરુશે, જકુસે”.
Interestingly, when the text is copied from the PDF or extracted using any AI/text tool, it is read and written correctly as “સુરેશ જુકેસ”.
This clearly indicates that the issue is not with the actual text data or Unicode encoding, but only with the visual rendering of the Anek Gujarati font in the PDF output.
sample_report.pdf
dadza commentedon Jan 8, 2026
Can you share a PDF where the text is rendered correctly using another font?
jayeshsony commentedon Jan 9, 2026
The PDF has been generated using the Arial Unicode MS font, and the text is now rendered correctly.
report_with_arial_unicode_font.pdf
dadza commentedon Jan 9, 2026
So the problem seems to be the placement of the two vowels ુ and ે relative to the consonants in the words. Can you confirm that?
jayeshsony commentedon Jan 12, 2026
Yes, that’s correct.
jayeshsony commentedon Mar 17, 2026
Any update on this?
dadza commentedon May 15, 2026
The problem has been resolved in a OpenPDF fork maintained by Jaspersoft. The commit that fixes the issue is Jaspersoft/OpenPDF@33eecab
You can find an OpenPDF jar containing the fix at https://jaspersoft.jfrog.io/ui/native/third-party-ce-artifacts/com/github/librepdf/openpdf/1.3.43.jaspersoft.2-SNAPSHOT/
JasperReports depends on the forked OpenPDF version at the moment. For the future we will create a pull request so that the fix gets into the official OpenPDF code.
Regards,
Lucian
use OpenPDF 1.3.43.jaspersoft.2-SNAPSHOT
improve glyph vector X position adjustement
dadza commentedon May 20, 2026
An improvement of the initial OpenPDF solution has been checked in at Jaspersoft/OpenPDF@c82bc87
The latest snapshot can be found at https://jaspersoft.jfrog.io/ui/native/third-party-ce-artifacts/com/github/librepdf/openpdf/1.3.43.jaspersoft.2-SNAPSHOT/
melloware commentedon Jun 1, 2026
@dadza please don't forget to provide upstream PR's to OpenLibre as this has broken Quarkus JasperReports because GRaalVM cannot find that method in the custom JAR we are using an official Quarkus OpenLibre jar.
See: quarkiverse/quarkus-jasperreports#284
melloware commentedon Jun 1, 2026
cc @andreasrosdal and @asturio it looks like JasperReports is making patches of OpenLibre to fix issues...
honor X positions in glyph vectors
improve glyph vector X position adjustement
dadza commentedon Aug 20, 2026
FYI two OpenPDF pull requests have been created for the Jaspersoft OpenPDF 1.3.43 changes:
LibrePDF/OpenPDF#1617
LibrePDF/OpenPDF#1618
Regards,
Lucian
honor X positions in glyph vectors