Free Support Forum - aspose.com

Right to left override in PDF

Hi,

I wasn’t sure if this is a pdf issue, aspose or combination. I am implementing RTL for Arabic. I am trying to support mix of Arabic and English. I am going through every run to set the proper bidi properties based on whether it’s English or Arabic. What I’m having an issue is punctuation. I’m manipulating it so that if the sentence ends with an English word the punctuation will appear on the left. Like so: .test زبتشبسمنتيس

I have accomplished this by the RTL unicode markers u202e and u202c. After trying multiple combinations I finally got it to work by surrounding the punctuation with these markers. Like so:
run.Text = “\u202e” + “.” + “\u202c”;

This is working in Word and the punctuation is coming out great, but PDF doesn’t like the unicode. The Font used was Arial, but I tried using Arial Unicode MS and it also didn’t work. In Arial the unicode shows up as some staff symbol where the unicode is placed. In Arial Unicode MS, the staff symbols don’t appear but the text is not modified to change the punctuations.

Could you provide some insight in regards to this? Thank you.

Aspose.Words 13.3.0.0

Hi David,

Thanks for your inquiry. Unfortunately, Aspose.Words does not support the requested feature at the moment. However, we had already logged this feature request as WORDSNET-7209 in our issue tracking system. Please see the following forum thread:

You will be notified via this forum thread once this feature is available. We apologize for your inconvenience.

I suggest you please try to save your document into MS Word document and then save to Pdf as shown in following code snippet. Hope this helps you.

Document doc = new Document();

// Your code.....

// Your code.....

doc.Save(MyDir + "out.docx");

Document doc2 = new Document(MyDir + "out.docx");

doc2.Save(MyDir + "out.pdf");