DS Server

TextPart Object

Object|Introduced in 24.0

Description

Represents a part of the document, which can be the main text, a header or footer or a text frame. The callback function argument for the getTextParts function.

Syntax

TextPart

Examples

The following example demonstrates TextPart in a practical document-editing workflow. It represents a part of the document, which can be the main text, a header or footer or a text frame. The callback function argument for the getTextParts function.

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

TXTextControl.textParts.getMainText(function(textPart) {
    textPart.getID(
        function(result) {
            console.log("get id result:", result);
        },
        onTxError
    );
}, onTxError);

Members

Properties

PropertyDescription
indexObsolete. This property will be removed in one of the next versions. The 0-based index of the text part.
selectionObsolete. This property will be removed in one of the next versions. The getter returns an object of type Selection. The setter changes the selection to a given start position and a given length using an object of type SelectionBounds.
typeObsolete. This property will be removed in one of the next versions. The Text part type. Possible values are "mainText", "headerFooter" and "textFrame".

Methods

MethodDescription
addSubTextPartObsolete. This method will be removed in one of the next versions. Inserts a new SubTextPart into the TextPart at the current input position.
addTextFieldObsolete. This method will be removed in one of the next versions. Inserts a new ApplicationField or TextField into the TextPart at the current input position.
getSubTextPartsObsolete. This method will be removed in one of the next versions. Requests a collection of either all subtextparts the current text part contains or only the subtextpart containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.
getTextFieldsObsolete. This method will be removed in one of the next versions. Requests a collection of either all text fields in the text part or only the text field containing the input position from the server and returns the collection by calling a callback function which has to be provided as a parameter to the function.
removeSubTextPartObsolete. This method will be removed in one of the next versions. Removes a SubTextPart from the TextPart.