How to show arabic,Hebrew,etc language fonts on jasper (iReport) reports

▼魔方 西西 提交于 2019-12-28 04:27:16

问题


I have this simple tabular report with many columns with different types .

But when printing the report with rtf (word) extension

the columns with numbers or date appears on the report.
the columns with with Arabic content appear on the report.

But when printing the report with PDF extension

the columns with numbers or date appears on the report.
the columns with with Arabic content DOES NOT appear on the report.

I have tried many different fonts and changed properties like PDF embed and PDF encoding. What is the right way to do this ?


回答1:


I faced this problem and its very annoying so to make it clear to all here how you do this

on the field or label that may has Arabic content go to its properties by right click or on the properties pallet of it , and make these changes

  1. Check the box PDF embed
  2. Choose Identity-H (Unicode with horizontal writing) from PDF encoding
  3. Choose the font Arial if not there add it to the jasper fonts folder in the installation directory and add it to the class path in settings

Rerun in PDF mode ... it will work




回答2:


I faced similar issue with Arabic text and found above solution helpful but it leads to another issues like JVM doesn't have Arial etc. And also we need to configure these properties on each and every field. Following configuration worked for me with the jasper latest versions.

  1. Use DejaVu Sans font(I used DejaVu Sans Mono)
  2. Add jasperreports-fonts dependency(In my case Jasper report version is 6.4.0 & jasper-fonts version is 6.0.0)
  3. If you need right to left layout use mirroring trick mentioned in iReport - How to change report direction to RTL?


来源:https://stackoverflow.com/questions/23359978/how-to-show-arabic-hebrew-etc-language-fonts-on-jasper-ireport-reports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!