Free Support Forum - aspose.com

Last evaluation steps

In my last evaluation step before purchasing the product I tried to write a simple word file with right to left flow, and I could not find a property whish perform this task.

I do not want alignment to the right I want fully flow layout from right to left as the button in the word does.

Please answer me if you support that so I can purchase the product…

Please attach the document you’ve tried to produce, and I will check what the problem is. BTW, what font have you used?

Generally, if you want to insert just a few lines of text in right-to-left mode, you should do the following:

DocumentBuilder builder = new DocumentBuilder(doc);

builder.ParagraphFormat.Bidi = true;

builder.Font.Bidi = true;

builder.Writeln("ﺵﺥﺩ");

builder.Writeln("ﺵﺥﺩ");

Run.Font.Bidi property sets the text direction in a run of text.
Paragraph.ParagraphFormat.Bidi sets the ordering of runs in paragraph and also inverts the meaning of ParagraphAlignment.Left and ParagraphAlignment.Right of ParagraphFormat.

To set text direction to right-to-left for all text in an already existing document use the following code:

NodeCollection paragraphs = doc.GetChildNodes(NodeType.Paragraph, true);

foreach(Paragraph paragraph in paragraphs)

{

paragraph.ParagraphFormat.Bidi = true;

}

NodeCollection runs = doc.GetChildNodes(NodeType.Run, true);

foreach(Run run in runs)

{

run.Font.Bidi = true;

}

I have corrected the previous post.

I can only add if you still can’t achieve what you want, post your code here and post the document created in MS Word like it should be.