We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

English text in Bidi Paragraph generated with Aspose.Words has the Language attribute set to Hebrew

Hi,

If I generate a Word object with one paragraph with one run of text - lets say: " this is english text." and open the generated Word document and put the cursor inside the run the Word application will display on the lower left corned as the language of the text Hebrew even if the text doesn’t contain any Hebrew characters.

The code to reproduce is:

var doc1 = new Document();
var paragraph = new Paragraph(doc1);
paragraph.ParagraphFormat.Bidi = true;
paragraph.ParagraphFormat.Alignment = ParagraphAlignment.Right;
var run = new Run(doc1) { Text = " this is english text." };
run.Font.Bidi = true;
paragraph.Runs.Add(run);
doc1.Save(@“C:\Document.docx”, SaveFormat.Docx);

Is there any way to make Word display the correct language.

Regards,
Lucian Nistor,
Senior .Net Developer,
IBM Romania

Hi Lucian,


Thanks for your inquiry. While running the latest version of Aspose.Words for .NET i.e. 13.9.0 in “en-US” culture, I was unable to reproduce this issue on my side. I would suggest you please upgrade to the latest version of Aspose.Words. You can download it from the following link:
http://www.aspose.com/community/files/51/.net-components/aspose.words-for-.net/default.aspx

I hope, this helps.

Moreover, I have attached the document i.e. produced on my side here for your reference.

Best regards,

Hi,

We are currently using Aspose.Words version 14.5.0.0 but we still encountering this issue just a bit different: the displayed language is Arabic (Saudi Arabia). I’m updating the code used to reproduce this issue (the previous one was missing the line for adding the paragraph to document):

var doc1 = new Document();
var paragraph = new Paragraph(doc1);
paragraph.ParagraphFormat.Bidi = true;
paragraph.ParagraphFormat.Alignment = ParagraphAlignment.Right;
var run = new Run(doc1) { Text = " this is english text." };
run.Font.Bidi = true;
paragraph.Runs.Add(run);
doc1.Sections[0].Body.Paragraphs.Add(paragraph);
doc1.Save(@“C:\Document.docx”, SaveFormat.Docx);


Could you please double-check and re-open this case ?

Thank you,
Aurelian Iordache
Software Developer
IBM Romania

Hi Aurelian,


Thanks for your inquiry. I have attached a .docx document i.e. generated with Aspose.Words for .NET 14.5.0 using your code and attached it here for your reference. Could you please also attach your expected word document here for our reference. You can create it using Microsoft Word. We just need to visualize as to how you want final output be generated like. We will then provide you code to achieve the same using Aspose.Words.

Best regards,