Search code examples
pdfxsltapache-fop

Display arabic text left to right in pdf using apache fop 0.95


We are generating pdf using apache's xsl fo engine, namely fop 0.95. We have been successful in displaying arabic text from xml to pdf. But there is some problem in the direction of the displayed words.

If we have 'sangam' (please assume that 'sangam' is in arabic) in xml, it gets displayed as 'magnas'. Has anyone encountered this before? What could be the solution?

For example, I have one node in xml file like this:

<empltmoblab>موبایل</empltmoblab>

Now when displayed in pdf, this is displayed like this:

لیابوم

This means I am getting just the reverse. I want it as it is in xml node.

Thank you.


Solution

  • I think it is interesting problem.It could be solved using bidi (bidirectional attribute ) to rtl (Right to Left ) but unfortunately its still not supported by fop. If any one has solution It would be very nice.

    I found out that in fop we can not render the arabic text at it should.

    The only work around found was to generate RTF document in place of PDF documents. In the RTF document, the arabic text displays as it is in the XML file.could you try using RTF in place of PDF? that has worked for me.

    Thanks.