How to set rulers position to right side using Aspose word

Hi,

I’m trying to set the ruler position to right side using below piece of code. However, it is not being set. Attaching the required resource. Could you please help me to understand whats the issue.?

Document ruler position before using the Aspose.Words

Code to set the ruler position

Ruler position after manipulating the doc using above code.

Please find code and sample document below. Thank you!
AsposeWordsRuler.zip (2.2 MB)
testword_ruler.docx (7.5 KB)

@nagasivaos What you are trying to change is a paragraph right indent. Тut in your code you change it for the first paragraph in your document only. Please try using the following simple code:

Document doc = new Document(@"C:\Temp\in.docx");
doc.LastSection.Body.LastParagraph.ParagraphFormat.RightIndent = 0;
doc.Save(@"C:\Temp\out.docx");

PS: Please do not share code examples as screenshots. This make them much harder to test.

Thank you for great help. It worked.
could you please also help on how to set the width of the paragraph. For ex:- if you look the below screenshot, I want set the width of each element to page width, but they are setting in one line. Could you please help me with it?

Actual:

Expected format is:

@nagasivaos The mentioned words are in one paragraph in the document object model. Width of paragraph content in your input document is specified by setting left and right indents of paragraph. So in your input document the content is wrapped into three lines.