Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 882
sangam Avatar asked Dec 03 '25 05:12

sangam


1 Answers

Try to use this:

    <fo:block-container writing-mode="rl-tb" font-family="ArabicTransparent" language="fa">
        <fo:block>
            علی‌ کریمی (Farsi-right-to-left)
        </fo:block>
    </fo:block-container> 
like image 141
kmi Avatar answered Dec 05 '25 17:12

kmi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!