Exporting PDF using JasperReport in Arabic

23 December 2008

Exporting PDF using JasperReport in Arabic

When you try to export PDF file using JasperReport in arabic characters, the characters may not be appeared specially in PDF format.

The key answer of this issue is quite pretty and sample.

In Desktop applications:

1 – Download Arial.ttf font .

2 – Put the Arial.ttf font in your application class path.

3 – From JasperReport designer:- Put your cursor on the properties of the detail in which it will display Arabic characters and select Arial.ttf font from PDF Font name and check isPdf Embedded checkbox and select Arial as a fontName and select “Identity-H as pdfEncoding.

Or you may also replace the font tag in your jrxml at the xml tab source with the following tag :

<font fontName=”Arial” pdfFontName=”ARIAL.TTF” size=”22 isPdfEmbedded =”true” pdfEncoding =”Identity-H”/>

Note: you can change your font size as much as you need.

In web applications :

Attempt almost the same desktop instructions but put your Arial.ttf font in the folder WEB-INF/classes and of course it will be relative to your application.

I hope it will be useful for you all :) .

Good Luck & Best Regards.

Entry Filed under: java. Tags: , , , , , , , , , , .

4 Comments Add your own

  • 1. Muhammad Owais Bilal  |  26 January 2009 at 3:56 pm

    Well my have the work is done and that is now Arabic in a static field is now working. However when I try to pass arabic from parameter again the same ? ? ?

    parameters.put(“Name2″, new String( “ا ب ت”));

    While compliing in iReports and promprting for the vlaue also work fine.

    Reply
  • 2. kenanah  |  26 January 2009 at 7:03 pm

    so what is the problem ?!?!?!?!?!?!?!?

    Reply
  • 3. Muhammad Owais Bilal  |  22 February 2009 at 1:34 pm

    ?ßÇá?É ???í? Çá? ???Çíáí
    is what I get….
    For Arabic text, after following your instructions.

    Do you also use some coding for your report as well. e.g.
    new String(“”.getBytes(), “UTF-8″)

    I other words my Arabic is not printed while running the report from Application.

    Reply
  • 4. kenanah  |  23 March 2009 at 2:17 pm

    This problem is related to Internationalization, and it is not related to IReport anymore.

    Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

December 2008
S M T W T F S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

Most Recent Posts