ViewOptionsDoNotDisplayPageBoundaries Property |
Namespace: Aspose.Words.Settings
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Insert content spanning 3 pages builder.Writeln("Paragraph 1, Page 1"); builder.InsertBreak(BreakType.PageBreak); builder.Writeln("Paragraph 2, Page 2"); builder.InsertBreak(BreakType.PageBreak); builder.Writeln("Paragraph 3, Page 3"); // Insert a header and a footer builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary); builder.Writeln("Header"); builder.MoveToHeaderFooter(HeaderFooterType.FooterPrimary); builder.Writeln("Footer"); // In this case we have a lot of space taken up by quite a little amount of content // In older versions of Microsoft Word, we can hide headers/footers and compact vertical whitespace of pages // to give the document's main body content some flow by setting this flag doc.ViewOptions.DoNotDisplayPageBoundaries = true; doc.Save(ArtifactsDir + "ViewOptions.DisplayPageBoundaries.doc");