tags:

views:

366

answers:

4

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

+1  A: 

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.

Thunder
@Thunder, you are right- the problem could be solved if the bidi-overeide property were supported in fop. But we don't have it for now.
sangam
A: 

hi sangam, can u tell me pls the steps to do to display arabic in pdf even with the direction problem?

Thanks

karine
+1  A: 

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> 
kmi
A: 

Sorry, but putting a write-mode="rl-tb" into a fo:blockcontainer fails in a screwy manner. It produces a right-to-left writing of the pixels, not the characters!

This is a killer in using fop-1.0 to produce Hebrew text. (Both Arabs and Jews can't get their text out in PDF by fop-1.0.)

Chris Kimball