VDocs.NET
HomeAPI Reference
Back to DOM

DOM.Elements.DocumentSection

Namespace: DOM.Elements

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

Ais anspecialized for section-level layout and page-specific settings. Sections define page behavior such as margins, orientation, headers, footers, columns, and grids, and are the primary unit for layout separation in a document.

16 members

Constructors

DocumentSection

DocumentSection()

Initializes a newwith default page settings.

The default configuration includes: A4 paper size Portrait orientation 1-inch margins on all sides Zero gutter A section break that starts on the next page

Properties

DocumentGrid

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

Document grids are commonly used in East Asian typography to align characters and enforce consistent line spacing.

FootersHeaderFooterType

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.

HeadersHeaderFooterType

Gets the collection of headers defined for this section.

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

PageColumns

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

Column settings control multi-column layouts, including column count, spacing, and optional separators.

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.

PageSettings

Gets or sets the page setup configuration for this section.

This includes page size, margins, gutter, and orientation. The settings apply to all pages generated within 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.

SectionBreakType

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

This value determines how the section is separated from the previous one, such as starting on the next page or continuing on the same page.

TextFlowDirection

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

This property controls how text flows within the section (for example, left-to-right or top-to-bottom).

VerticalTextAlignmentOnPage

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

Controls whether content is aligned to the top, center, bottom, or distributed vertically across the page.

Methods

AddFooter

2 overloads
IDocumentFooter AddFooter(IDocumentFooter footer)

Adds an existing footer to the section.

Parameters

footer
The footer instance to add.

Returns

IDocumentFooter

The addedinstance.

Exceptions

  • System.Exception: Thrown when a footer of the samealready exists.
IDocumentFooter AddFooter(HeaderFooterType footerType)

Creates and adds a new footer of the specified type to the section.

Parameters

footerType
The type of footer to create.

Returns

IDocumentFooter

The newly createdinstance.

AddHeader

2 overloads
IDocumentHeader AddHeader(IDocumentHeader header)

Adds an existing header to the section.

Parameters

header
The header instance to add.

Returns

IDocumentHeader

The addedinstance.

Exceptions

  • System.Exception: Thrown when a header of the samealready exists.
IDocumentHeader AddHeader(HeaderFooterType headerType)

Creates and adds a new header of the specified type to the section.

Parameters

headerType
The type of header to create (for example, default or first page).

Returns

IDocumentHeader

The newly createdinstance.

AddText

IText AddText(string text)

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

This override ensures that raw text added at the section level is always wrapped inside a paragraph, preserving structural integrity.

Parameters

text
The textual content to add to the section.

Returns

IText

The createdinstance.