ParagraphFormat.LeftIndent property

Gets or sets the value (in points) that represents the left indent for paragraph.

public double LeftIndent { get; set; }


Shows how to configure paragraph formatting to create off-center text.

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

// Center all text that the document builder writes, and set up indents.
// The indent configuration below will create a body of text that will sit asymmetrically on the page.
// The "center" that we align the text to will be the middle of the body of text, not the middle of the page.
ParagraphFormat paragraphFormat = builder.ParagraphFormat;
paragraphFormat.Alignment = ParagraphAlignment.Center;
paragraphFormat.LeftIndent = 100;
paragraphFormat.RightIndent = 50;
paragraphFormat.SpaceAfter = 25;

    "This paragraph demonstrates how left and right indentation affects word wrapping.");
    "The space between the above paragraph and this one depends on the DocumentBuilder's paragraph format.");

doc.Save(ArtifactsDir + "DocumentBuilder.SetParagraphFormatting.docx");

See Also