DOM.Elements.DocumentSection
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
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.
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.
Gets the collection of headers defined for this section.
Each header is associated with a specific(for example, default, first page, or even pages).
Gets or sets the column configuration for pages in this section.
Column settings control multi-column layouts, including column count, spacing, and optional separators.
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.
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.
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.
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.
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).
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
AddHeader
2 overloadsIDocumentHeader 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.