VegaRise.NET
Back to DOM

DocumentSectionClass

Definition

Namespace
DOM.Elements
Assembly
DOM.dll

Represents a top-level document section that can contain pages and other flow elements (images, paragraphs, shapes, tables, text, paths).

Remarks

A is an specialized for section-level layout and page-specific settings. DocumentSection ElementsContainer Sections define page behavior such as margins, orientation, headers, footers, columns, and grids, and are the primary unit for layout separation in a document.

Examples

csharp
1// 1. Add a section with custom page settings
2var section = doc.AddSection();
3section.PageSettings.Orientation = PageOrientation.Landscape;
4section.AddParagraph().AddText("This section is in landscape orientation.");
5
csharp
1// 2. Portrait + landscape mix
2var portrait = doc.AddSection();
3portrait.PageSettings = new PageSetup
4{
5 PageSize = new PageSize(PaperSize.Letter),
6 Orientation = PageOrientation.Portrait
7};
8portrait.AddParagraph().AddText("Portrait section");
9
10var landscape = doc.AddSection();
11landscape.PageSettings = new PageSetup
12{
13 PageSize = new PageSize(PaperSize.Letter),
14 Orientation = PageOrientation.Landscape
15};
16landscape.AddParagraph().AddText("Landscape section");
17
csharp
1// 3. Right-to-left section
2var rtl = doc.AddSection();
3rtl.RightToLeftLayout = true;
4rtl.TextFlowDirection = TextDirectionValues.rl;
5rtl.AddParagraph().AddText("مرحبا بالعالم");
6
csharp
1// 4. Section with different first-page header
2var section = doc.AddSection();
3section.AddHeader(HeaderFooterType.First).AddParagraph().AddText("Cover Page");
4section.AddHeader(HeaderFooterType.Default).AddParagraph().AddText("Confidential");
5

Constructors

DocumentSection()

Initializes a new with default page settings. DocumentSection

Properties

DocumentGridIDocumentGrid

Gets or sets the document grid used to align characters and lines.

Gets the collection of footers defined for this section.

Each footer is associated with a specific . Only one footer of each type is allowed per section. HeaderFooterType

Gets the collection of headers defined for this section.

Each header is associated with a specific (for example, default, first page, or even pages). HeaderFooterType

PageColumnsIPageColumns

Gets or sets the column configuration for pages in this section.

Pages

Gets the collection of pages that belong to this section.

Pages are generated based on the content flow and section settings. This collection reflects page-level abstractions in the DOM.

PageSettingsIPageSetup

Gets or sets the page setup configuration for this section.

RightToLeftLayout

Gets or sets a value indicating whether the layout for this section should be rendered right-to-left.

This is typically used for languages such as Arabic or Hebrew.

SectionBreakTypeSectionMarkValues

Gets or sets the type of section break that precedes this section.

TextFlowDirectionTextDirectionValues

Gets or sets the logical text flow direction for the section.

VerticalTextAlignmentOnPageVerticalJustificationValues

Gets or sets the vertical alignment (justification) of content on the page.

Methods

Adds an existing footer to the section.

Adds an existing header to the section.

Adds a text node to the section by creating a new paragraph and appending the text to it.

VegaRise.NET

Sign In

Welcome back. Please sign in to your account.

Forgot password?
or

Don't have an account? Create an account

By signing in, you agree to our Terms of Service and Privacy Policy.