DocumentBuilderInsertParagraph Method |
Namespace: Aspose.Words
Current paragraph formatting specified by the ParagraphFormat property is used.
Breaks the current paragraph in two. After inserting the paragraph, the cursor is placed at the beginning of the new paragraph.
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Specify font formatting Aspose.Words.Font font = builder.Font; font.Size = 16; font.Bold = true; font.Color = Color.Blue; font.Name = "Arial"; font.Underline = Underline.Dash; // Specify paragraph formatting ParagraphFormat paragraphFormat = builder.ParagraphFormat; paragraphFormat.FirstLineIndent = 8; paragraphFormat.Alignment = ParagraphAlignment.Justify; paragraphFormat.AddSpaceBetweenFarEastAndAlpha = true; paragraphFormat.AddSpaceBetweenFarEastAndDigit = true; paragraphFormat.KeepTogether = true; builder.Writeln("A whole paragraph."); // We can use this flag to ensure that we're at the end of the document Assert.True(builder.CurrentParagraph.IsEndOfDocument);