Created
January 21, 2025 09:01
-
-
Save aspose-words-gists/ecf2c438314e6c8318ca9833c7f62326 to your computer and use it in GitHub Desktop.
Aspose.Words for .NET. Document builder overview using C#.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git. | |
Document doc = new Document(); | |
DocumentBuilder builder = new DocumentBuilder(doc); | |
Font font = builder.Font; | |
font.Size = 16; | |
font.Bold = true; | |
font.Color = Color.Blue; | |
font.Name = "Arial"; | |
font.Underline = Underline.Dash; | |
ParagraphFormat paragraphFormat = builder.ParagraphFormat; | |
paragraphFormat.FirstLineIndent = 8; | |
paragraphFormat.Alignment = ParagraphAlignment.Justify; | |
paragraphFormat.KeepTogether = true; | |
builder.Writeln("A whole paragraph."); | |
doc.Save(ArtifactsDir + "AddContentUsingDocumentBuilder.InsertParagraph.docx"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-.NET.git. | |
Document doc = new Document(MyDir + "Bookmarks.docx"); | |
DocumentBuilder builder = new DocumentBuilder(doc); | |
builder.MoveToBookmark("MyBookmark1", false, true); | |
builder.Writeln("This is a bookmark."); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment