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

Free Support Forum - aspose.com

Set Paper Size to A4, Right Alignment and Indentation for Paragraphs in Word DOCX | C# .NET

How i can write text in right paragraph buth all lines must begin from left as exam[le
image.png (3.9 KB)


Please compress your input Word document and your expected DOCX file showing the desired behavior into ZIP format and attach the .zip file here for our reference. You can create this expected file manually by using MS Word. We will then investigate the scenario on our end and provide you code to achieve the same output by using Aspose.Words.

Excample.docx (13.1 KB)
Example what i want


Please try the following C# code of Aspose.Words for .NET API to write text after adjusting the left indentations and alignments of Paragraphs in Word document:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.PageSetup.PaperSize = PaperSize.A4;
builder.PageSetup.TopMargin = builder.PageSetup.BottomMargin = 0.79 * 72;
builder.PageSetup.LeftMargin = 1.18 * 72;
builder.PageSetup.RightMargin = 0.59 * 72;

builder.ParagraphFormat.LeftIndent = 3.94 * 72;
builder.Writeln("to protokol 55 from Anna");
builder.Writeln("about people and animals");
builder.Writeln("from _____________ № ______");

builder.ParagraphFormat.LeftIndent = 0;

builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;

builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;