PageSetupLayoutMode Property

Gets or sets the layout mode of this section.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.10.0

ExpandedSyntax

public SectionLayoutMode LayoutMode { get; set; }

Property Value

Type: SectionLayoutMode

ExpandedExamples

Shows how to create headers and footers different for first, even and odd pages using DocumentBuilder.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

PageSetup pageSetup = builder.PageSetup;
pageSetup.DifferentFirstPageHeaderFooter = true;
pageSetup.OddAndEvenPagesHeaderFooter = true;
pageSetup.LayoutMode = SectionLayoutMode.LineGrid;
pageSetup.CharactersPerLine = 1;
pageSetup.LinesPerPage = 1;

builder.MoveToHeaderFooter(HeaderFooterType.HeaderFirst);
builder.Writeln("First page header.");

builder.MoveToHeaderFooter(HeaderFooterType.HeaderEven);
builder.Writeln("Even pages header.");

builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.Writeln("Odd pages header.");

// Move back to the main story of the first section
builder.MoveToSection(0);
builder.Writeln("Text page 1.");
builder.InsertBreak(BreakType.PageBreak);
builder.Writeln("Text page 2.");
builder.InsertBreak(BreakType.PageBreak);
builder.Writeln("Text page 3.");

doc.Save(ArtifactsDir + "PageSetup.DifferentHeaders.docx");

ExpandedSee Also