ParagraphFormatSpaceBeforeAuto Property |
Namespace: Aspose.Words
When set to true, overrides the effect of SpaceBefore.
When you set paragraph Space Before and Space After to Auto, Microsoft Word adds 14 points spacing between paragraphs automatically according to the following rules:
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");