TX Text Control .NET Server

Javascript: FrameBase.getTextDistances Method

Method|Introduced in 28.0

Description

Gets the distances, in twips, between the frame and the document's text.

Syntax

<void> FrameBase.getTextDistances(<RequestDistancesCallback> 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.getTextDistances in a practical document-editing workflow. It gets the distances, in twips, between the frame and the document's text.

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

function inspectTextDistances(frameBase) {
    frameBase.getTextDistances(
        function(distances) {
            if (!distances) {
                console.warn("No distances was returned.");
                return;
            }
            
            console.log("get text distances result:", distances);
        },
        onTxError
    );
}