SectionLayoutMode Enumeration |
Specifies the layout mode for a section allowing to define the document grid behavior.
Namespace:
Aspose.Words
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntaxpublic enum SectionLayoutMode
Public Enumeration SectionLayoutMode
public enum class SectionLayoutMode
Members
| Member name | Value | Description |
---|
| Default | 0 |
Specifies that no document grid shall be applied to the contents of the corresponding section in the document.
|
| Grid | 1 |
Specifies that the corresponding section shall have both the additional line pitch and character pitch
added to each line and character within it in order to maintain a specific number
of lines per page and characters per line.
Characters will not be automatically aligned with gridlines on typing.
|
| LineGrid | 2 |
Specifies that the corresponding section shall have additional line pitch added to each line within it
in order to maintain the specified number of lines per page.
|
| SnapToChars | 3 |
Specifies that the corresponding section shall have both the additional line pitch and character pitch
added to each line and character within it in order to maintain a specific number
of lines per page and characters per line.
Characters will be automatically aligned with gridlines on typing.
|
ExamplesCreates headers and footers different for first, even and odd pages using DocumentBuilder.
DocumentBuilder builder = new DocumentBuilder();
PageSetup ps = builder.PageSetup;
ps.DifferentFirstPageHeaderFooter = true;
ps.OddAndEvenPagesHeaderFooter = true;
ps.LayoutMode = SectionLayoutMode.LineGrid;
ps.CharactersPerLine = 1;
ps.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.");
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.");
builder.Document.Save(ArtifactsDir + "PageSetup.DifferentHeaders.doc");
See Also