Free Support Forum -

Arabic Sentence not coming from Right to Left

Hi there

We are using Aspose Words

We are trying to create word file with Arabic characters and the following sentence is the input into the write function.

"هل قال لك أحد لماذا إختارلك بيت العائلة هذا بالذات؟"

But the output of the word document contains reverse of the above sentence.

Kindly please check the attached sample output and code file.

Please advise us.


Hi John,

Thanks for your inquiry. Font.Bidi property specifies whether the contents of this run shall have right-to-left characteristics. Please use Font.LocaleIdBi property to get or set the locale identifier (language) of the formatted right-to-left characters as shown below. Hope this helps you.

We have tested the scenario using latest version of Aspose.Words for .NET 16.11.0 and have not found the shared issue. Please use Aspose.Words for .NET 16.11.0.

var doc = new Document();

var builder = new DocumentBuilder(doc);

PageSetup pagesetup = builder.PageSetup;

pagesetup.PaperSize = PaperSize.A4;

pagesetup.LeftMargin = 65.00;

pagesetup.RightMargin = 39.00;

pagesetup.TopMargin = 40.00;

pagesetup.BottomMargin = 18.00;

pagesetup.Orientation = Aspose.Words.Orientation.Landscape;

pagesetup.HeaderDistance = 25;

pagesetup.TopMargin = ConvertUtil.MillimeterToPoint(25);



// Specify the locale so Microsoft Word recognizes this text as Arabic - Saudi Arabia.

// For the list of locale identifiers see

builder.Font.LocaleIdBi = 1025;

// Signal to Microsoft Word that this run of text contains right-to-left text.

builder.Font.Bidi = true;

builder.Font.BoldBi = false;

// Specify the font and font size to be used for the right-to-left text.

builder.Font.NameBi = "Andalus";


doc.Save(MyDir + "Out v16.11.0.doc");

Hi Tahir

It works like a charm.

Thanks for your quick reply.

Hi John,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.