Live TextFrame API
Position editable content in text frames
Insert a frame at the caret, compare inline and paragraph-anchored placement, and select it in the document to inspect its live properties.
AaSelect a text frameClick its border in the editor or choose one from the collection below.
Selected text frame
Text frame
Anchored
AaParagraph anchor · text flows around the frame
Size-
Text position-
Alignment-
Location-
Movable-
Resizable-
Text frames in this document
0 frames
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
A positioned object and an editable text part
A text frame is more than a box drawn over a page. Its placement, geometry, borders, background, and text flow belong to the frame, while its content exposes a separate Selection, paragraphs, tables, fields, and other document collections.
Frame collection
TXTextControl.textFrames
Placement
TextFrameCollection.addInline / addAnchored
Frame geometry
TextFrame.getSize / getLocation / getTextPosition
Frame content
TextFrame.selection
How it works
TextFrameCollection.addInline inserts a frame as a single character at the current text position. It follows the surrounding text during editing. TextFrameCollection.addAnchored connects the frame to a paragraph and uses TextFrameInsertionMode.AboveTheText, so document text flows around it.
The insertion callback receives the new TextFrame. The demo assigns its initial content through TextFrame.selection.setText, then configures its name, background, border, and mouse behavior. All calls remain asynchronous and use the JavaScript API callbacks.
The textFrameSelected and textFrameDeselected events synchronize the inspector with the editor. Properties such as getSize, getTextPosition, getAlignment, getMoveable, and getTransparency are read from the selected object rather than duplicated in the page.
Calling TextFrame.activate moves the input focus into the frame. At that point, its own Selection and document-object collections can be manipulated like the main document text.
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