GUIDED API LAB
Loading lesson...
The coding workspace is preparing the first Selection exercise.
Execution profile
Live selection operations—
Prepared assignments—
Document writes—
Ready to tryUse the controls above to interact with this demo.
Server-side document API
Prepare content before insertion
A detached Selection object can carry text and character formatting before it touches the document. Assigning that prepared object to ServerTextControl.Selection inserts the complete fragment in one operation.
Build a formatted fragment
new Selection / Text / Bold / FontSize / ForeColor
Insert the prepared fragment
ServerTextControl.Selection = preparedSelection
Compare the live pattern
Selection.Text / ServerTextControl.Select / Selection formatting
Render document pages
ServerTextControl.GetPages / Page.GetImage
Technique adapted from Speed Up Document Generation Using Selection Objects.
How the lab executes code
The submitted statements are parsed against a small allowlist that supports live selection operations and named, detached Selection objects. The application does not compile or execute arbitrary CLR code.
Each run returns operation counts, evaluates lesson-specific checks, and renders every document page as SVG through Page.GetImage. The comparison runs both fixed generation patterns repeatedly and reports their measured average on the current server.
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