ViewOptionsDoNotDisplayPageBoundaries Property

Turns off display of the space between the top of the text and the top edge of the page.

Namespace:  Aspose.Words.Settings
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool DoNotDisplayPageBoundaries { get; set; }

Property Value

Type: Boolean
Examples
Shows how to hide vertical whitespace and headers/footers in view options.
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");
See Also