TX Text Control .NET Server

Javascript: TextFrame.getTextPosition Method

Method|Introduced in 28.0

Description

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

Syntax

<void> TextFrame.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 TextFrame.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(textFrame) {
    textFrame.getTextPosition(
        function(result) {
            console.log("get text position result:", result);
        },
        onTxError
    );
}