Document Constructor |
The document paper size is Letter by default. If you want to change page setup, use Section.PageSetup.
After creation, you can use DocumentBuilder to add document content easily.
Document doc = new Document(); Run run = new Run(doc, "Hello world!"); Aspose.Words.Font font = run.Font; font.Name = "Courier New"; font.Size = 36; font.HighlightColor = Color.Yellow; doc.FirstSection.Body.FirstParagraph.AppendChild(run); doc.Save(ArtifactsDir + "Font.CreateFormattedRun.docx");