ParagraphFormatSpaceAfter Property

Gets or sets the amount of spacing (in points) after the paragraph.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public double SpaceAfter { get; set; }

Property Value

Type: Double
Exceptions
ExceptionCondition
ArgumentOutOfRangeException Throws when argument was out of the range of valid values.
Remarks

Has no effect when SpaceAfterAuto is true.

Valid values ​​range from 0 to 1584 inclusive.

Examples
Shows how to work with paragraph spacing.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Set the amount of white space before and after each paragraph to 12 points
builder.ParagraphFormat.SpaceBefore = 12.0f;
builder.ParagraphFormat.SpaceAfter = 12.0f;

// We can set these flags to apply default spacing, effectively ignoring the spacing in the attributes we set above
Assert.False(builder.ParagraphFormat.SpaceAfterAuto);
Assert.False(builder.ParagraphFormat.SpaceBeforeAuto);
Assert.False(builder.ParagraphFormat.NoSpaceBetweenParagraphsOfSameStyle);

// Insert two paragraphs which will have padding above and below them and save the document
builder.Writeln("Paragraph 1.");
builder.Writeln("Paragraph 2.");

doc.Save(ArtifactsDir + "Paragraph.ParagraphSpacing.docx");
See Also