Live Stylesheet API
Explore the document's styles
Move the caret through the document. The active paragraph style and its reusable definition are reflected automatically.
Current paragraph style
Waiting for the editor
A style belongs to the document, not to this user interface.
Document style library
0 styles
Aa
Selected definition
No style selected
Base style-
Following style-
Font-
Size-
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Reusable formatting instead of isolated changes
A paragraph style stores a named formatting definition in the document. Applying the name keeps visual intent separate from individual font and paragraph properties.
Style collection
TXTextControl.paragraphStyles
Current style
Selection.getFormattingStyle
Apply by name
Selection.setFormattingStyle
Refresh styled content
FormattingStyle.apply
How it works
TXTextControl.paragraphStyles contains the paragraph-style definitions embedded in the current document. The demo reads each ParagraphStyle through callback-based methods and builds the library from the document itself, so no style names are hard-coded.
Selection.getFormattingStyle reports the style at the caret. Passing a library entry to Selection.setFormattingStyle applies that named definition to the selected paragraphs while preserving its semantic role.
The style API stores font sizes in twips. The controls convert between twips and points so the displayed value matches familiar word-processing measurements.
Styles can inherit from a base style and specify a following style for the paragraph created when Enter is pressed. These relationships make structured documents predictable without duplicating every formatting attribute.
Updating the selected ParagraphStyle changes its definition. Calling FormattingStyle.apply then refreshes all content using that style, demonstrating how a single brand change can update an entire Word-compatible document.
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