DS Server

Javascript: FrameBase.getTextPosition Method

Method|Introduced in 28.0

Description

Gets the frame's character position in the document's text (one-based).

Syntax

<void> FrameBase.getTextPosition(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the current property value.

errorCallback

Optional. Is called when the operation failed with an error.

Examples

The following example demonstrates FrameBase.getTextPosition in a practical document-editing workflow. It gets the frame's character position in the document's text (one-based).

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

function inspectTextPosition(frameBase) {
    frameBase.getTextPosition(
        function(result) {
            console.log("get text position result:", result);
        },
        onTxError
    );
}