DS Server

TextFrameCollection Object

Object|Introduced in 28.0

Description

Contains all text frames of a Text Control document or part of the document.

Syntax

TextFrameCollection

Examples

The following example demonstrates TextFrameCollection in a practical document-editing workflow. It contains all text frames of a Text Control document or part of the document.

function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

TXTextControl.textFrames.getItem(
    function(textFrame) {
        if (!textFrame) {
            console.warn("No text frame was returned.");
            return;
        }
        
        console.log("get item result:", textFrame);
    },
    onTxError,
    25
);

Members

Methods

MethodDescription
addAnchoredCreates and inserts a new text frame which is anchored to the specified text position. It has the specified horizontal alignment and a textflow which is given through the insertionMode parameter. Anchored text frames are moved with the text.
addAnchoredAtLocationInserts a new text frame which is anchored to the specified text position. It has the specified location relative to the paragraph it is anchored to and a textflow which is given through the insertionMode parameter. Anchored text frame are moved with the text.
addAtFixedPositionInDocumentCreates and inserts a new text frame which has a fixed geometrical position in the document. This position is specified through a location relative to the top left corner of the complete document. All gaps between the pages must be included.
addAtFixedPositionOnPageInserts a new image which has a fixed geometrical position in the document. This position is specified through a page number and a location on this page.
addInlineInserts a text frame inline, which means that it is treated in the text like a single character. The text frame is inserted at the specified text input position.
addWithMouseInserts a text frame with the built-in mouse interface. The text frame's size is determined through the end-user. A cross cursor indicates where the text frame can be inserted. Changing the document aborts the insertion process.
clearRemoves all objects from the collection and from the document. (Inherited from FrameBaseCollection.)
getItemGets the text frame selected by the user or the text frame with the specified identifier.
getItemByNameGets the text frame with the specified name.
removeRemoves a text frame from a Text Control document.