Jump to content
JasperReports Library 7.0 is now available ×

Problem with arabic characters in PDF


capitaleArg

Recommended Posts

Hi people

I'm facing problems to export PDF reports with arabic characters. When I generate a HTML report, they are correctly shown, but when I generate a PDF one, only '?????' is shown.

I tried to set the PDF encoding of the fields to Cp1256 (Arabic) but it didn't work. Everything else in the report is set to UTF-8.

Could anybody help me with this problem?

Regards
Capitale Arg

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

This might be because the Fonts used for displaying the PDF report doesn't support Cp1256 (Arabic).

One of my friends had faced the similar problem.He had solved this successfully by using 'Arial' font in the report.

Thanks

-Amod

Link to comment
Share on other sites

Hi

Thanks for your reply. I tried using Arial (arial.ttf) and Arial Unicode MS (ARIALUNI.TTF), but none of them worked. I'm testing in iReports 2.0.5 only, not in a real application to save time. Could this be a problem?

I'm sort of lost with this problem, any other help will be very welcome.

Bye
Capitale Arg

Link to comment
Share on other sites

Hello,

I don't think running the report in the iReport tool  would be a problem.I want to know how you have tried using these fonts.If you have specified them in the 'reportFont' tag in jrxml file then,you have to mention pdfEncoding something like 'Identity-H'.Also in this tag, you can define the path at which the font file(ttf) is located. Let us see if this works out..

Thanks

-Amod

Link to comment
Share on other sites

  • 1 year later...
  • 6 years later...

FontProperties.PNG.6a1fe8e8c00b85a56e5b8b3ba32225d7.PNGArabicProperties.PNG.a0aa7108c51518f27d5bf3a1a3adea3c.PNGjasper-extension-properties.PNG.130afec87b7e36e0a91c21d55637eb5e.PNGAfter all workarounds, i am able to fix this issue in Jasper ireport as follows


In Text Properties :


Font Name : Arial


Pdf Font Name : ../arial.ttf


Pdf Embedded : true


Pdf Encoding : Identity-H


-------------------------------------------------------


In your Project META-INF folder


Create and Add reports folder containing arial.ttf files and font.xml


Outside META-INF folder, add jasper-extensions.properties file


So finally,  


jasper-extensions.properties --- Uses --- fonts.xml --- Uses --- true type font files   


jasper-extensions.properties file --> fonts.xml ---> arial.ttf 


 


Regards,


Satish M Hiremath


Bangalore, Karnataka, India


satishmhiremath@gmail.com


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...