I’ve attached 2 documents. One Word and one Pdf.
Aspose.Words 13.3.0.0
The issue:
I am using a style to set the bidi properties for some text to be entered in the document. It is not known whether the text will be English or Arabic. When it is in Arabic everything is properly formatted in both Word and Pdf. When it is in English the text gets reversed in Word but not Pdf. However, if the text is mixed content it is properly formatted.
I am using the following code. Basically setting the bidi for the font and the the localid to arabic.
style.Font.Bidi = IsRtl(culture);
style.Font.LocaleIdBi = CultureInfo.GetCultureInfo(culture).LCID;
The style is being applied like so
paragraph.ParagraphFormat.Style = mystyle;
paragraph.ParagraphFormat.Bidi = mystyle.ParagraphFormat.Bidi;
_builder.MoveTo(paragraph);
_builder.Write(mytext);
Do you know why it’s proper in pdf and mirrored in word. Is this a bug?
Hi David,
Thanks for the reply. While we further implemented bidi properties. We noticed this issue only occurs in Word 2013. The documents will view fine in Word 2010 but the same document if opened in Word 2013 will have reversed English text.
Hi David,
I’ve attached a sample console app. The output displays correctly in Word 2010 and incorrectly in Word 2013 with the output document generated.
Sorry to add another issue on top but we also noticed issues with hypenated words. The words get jumbled. Noted it displays properly in OpenOffice, improperly in Word 2010.
ie
input:This-is a test
result: is a test-This
or
input: start this-is a test فاهس هس ش فثسف end
result: end فاهس هس ش فثسف is a test-start this
David:
I've attached a sample console app. The output displays correctly in Word 2010 and incorrectly in Word 2013 with the output document generated.
David:
Sorry to add another issue on top but we also noticed issues with hypenated words. The words get jumbled. Noted it displays properly in OpenOffice, improperly in Word 2010.ieinput:This-is a testresult: is a test-Thisorinput: start this-is a test فاهس هس ش فثسف endresult: end فاهس هس ش فثسف is a test-start this
Thanks again for looking into our issues. I’ve attached the console app I made before with the additional code to test for the hypen issue.
We are also testing bidi on pdf and have noticed some issues. Would you prefer we open another posting regarding pdf or proceed in this posting?
Hi David,
Hi David,
Document _documentNode = new Aspose.Words.Document();
DocumentBuilder _builder = new DocumentBuilder(_documentNode);
paragraph = _builder.InsertParagraph();
paragraph.ParagraphFormat.Bidi = true;
_builder.Write("test");
paragraph = _builder.InsertParagraph();
_builder.Write("Start يبنتشبنشم end");
paragraph = _builder.InsertParagraph();
_builder.Write("فاهس هس ش فثسف end");
paragraph = _builder.InsertParagraph();
_builder.Write("start فاهس هس ش فثسف");
_documentNode.Save(@"C:\Temp\out.doc", SaveFormat.Doc);
Hi David,