Jump to content
  • Bidirectional unicode text not exporting correctly

    Assigned User teodord
    CategoryBug report

    Original issue moved from:



    Consult the original issue for any attachments.


    [ 1380345 ] Bidirectional unicode text not exporting correctly


    Submitted By: ifx - ifx

    Date Submitted: 2005-12-14 03:43

    Last Updated By: svpatil - Comment added

    Date Last Updated: 2006-03-23 22:16

    Number of Comments: 5

    Number of Attachments: 1


    Assigned To: Nobody/Anonymous

    Priority: 5



    Bidirectional unicode text not exporting correctly


    Bidirectional unicode only seems to be formatted correctly when it is exported to HTML, and does not seem to work correctly under PDF, RTF etc.


    The following unicode directional characters should be supported:

    LRE (202A) - Left to right embedding

    RLE (202B) - right to left embedding

    PDF (202C) - pop directional formatting

    LRO (202D) - left to right override

    RLO (202E) - right to left override




    Date: 2006-03-23 22:16

    Sender: svpatil

    Logged In: YES



    Hi teodord,


    Thanks for your suggestion!! As you suggested it was the problem with pdfEncoding & pdfFontName. The sample jrxml for unicode uploaded at JasperReports.sourceforce.net helped me a lot. Now its working fine with arabic chars also.


    Thanks Again!





    Date: 2006-03-23 03:00

    Sender: svpatil

    Logged In: YES



    hi teodord,


    Better let me explain the problem in more detail. I'm exporting the jasper generated arabic report (XML) to pdf format. I'm sure that pdfEncoding, pdfEmbedded attributes in the prticular XML are proper. But, still the Arabic charachters are coming as '?' marks. I'v traced the jasper code also but I'm not finding any point where Arabic Chars are getting converted as '?' symbols. Please help me ASAP, its very critical issue for me.


    Thanks in ADVANCE!



    Date: 2006-03-20 04:00

    Sender: teodordProject Admin

    Logged In: YES






    I don't think this is the same problem. You should look at the supplied "unicode" sample and see what you need to do in order to correctly see Arabic text in PDF and the other formats. It is about using the pdfFontName, pdfEncodding and isPdfEmbedded attributs.


    I hope this helps.





    Date: 2006-03-19 21:48

    Sender: svpatil

    Logged In: YES



    I'm also facing the problem of saving the jasper generated report as pdf/xls/txt file. The characters of Arabic language (bidirectional unicode) are not getting exported to

    pdf format. Please anybody can help me out? its urgent.


    Date: 2006-01-11 09:05

    Sender: teodordProject Admin

    Logged In: YES





    What versions of JR and iText are you using? We found what causes the problem in AWT (JasperViewer), but here it seems to work OK in PDF.


    Do you know what encoding is used when storing this Hebrew text in your database or data files?


    Thank you,



    Attached Files:


    unicode_bidi.zip, Input and output examples

    Attachments: unicode_bidi.zip

    User Feedback

    Recommended Comments




    We found a problem with rendering bidirectional text inside our TextRenderer class where paragraphs are layed out using AWT.

    The cause was a fix made years ago to workaround a JVM bug related to the huge size of printer jobs produced from Java.


    There is now a new configuration property (JRGraphics2DExporter.MINIMIZE_JOB_SIZE) and a Graphics2D exporter parameter (JRGraphics2DExporterParameter.MINIMIZE_JOB_SIZE) to control the use of the mentioned job size fix.


    Basically, if you have bidirectional text inside a document, you cannot make use of the printer job size optimisation, because it will ruin the bidirectional text and the property of the exporter parameter should be used to turn the optimization OFF.

    By default, the optimization is turner ON, for backward compatibility reasons.


    Using the supplied sample, we did not find any problem with the PDF and RTF exporters.


    The addions was commited to SVN and will be part of the next release.

    It would be great if you could test it and give us feedback.


    Thank you,



    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...