ParagraphFormatSpaceAfter Property |
Namespace: Aspose.Words
Exception | Condition |
---|---|
ArgumentOutOfRangeException | Throws when argument was out of the range of valid values. |
Has no effect when SpaceAfterAuto is true.
Valid values range from 0 to 1584 inclusive.
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");