Live Section API
Inspect the document structure
Move the caret or choose a section below. Every page preview is generated from the section settings stored in the document.
Current sectionWaiting for the editor
Loading document structure
Document sections
0 sections
Format the current section
Orientation
Columns
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Independent page layouts in one document
Sections divide a document into independently formatted ranges. Each section can define its own page geometry, columns, borders, headers, footers, and numbering behavior.
Section collection
TXTextControl.sections
Current layout
Selection.sectionFormat
Page geometry
SectionFormat.pageSize / pageMargins
Page border
SectionFormat.pageBorder
How it works
TXTextControl.sections exposes the complete document structure. The demo reads each Section, including its text range and SectionFormat, and builds the navigator directly from the loaded document.
The section containing the input position is returned by SectionCollection.getItem. Its read-only format property exposes mutable objects for page size, margins, and borders, while Selection.sectionFormat provides a convenient route for editing the current section.
Page size and margins use the document's current page unit, while page-border widths use twips. This document uses hundredths of an inch, so the demo displays page geometry in inches and converts the point-based margin presets before applying them.
A missing page border has zero-width lines. The colored-border action first assigns a visible width to the line-width properties supported by the active client and then colors every side independently. Only the active section changes; neighboring sections retain their own layout.
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Provides the browser-based TX Text Control document editor and JavaScript API.
dotnet add package TXTextControl.Web --version 34.4.0
TXTextControl.Web.DocumentEditor.Backend
34.4.0
Hosts the WebSocket-based backend used by the browser document editor.
dotnet add package TXTextControl.Web.DocumentEditor.Backend --version 34.4.0