TX Text Control .NET Server

Javascript: FrameBase.setTextDistances Method

Method|Introduced in 28.0

Description

Sets the distances, in twips, between the frame and the document's text. If a value is set to -1, it is not changed.

Syntax

<void> FrameBase.setTextDistances(<Distances> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
value

The new property value.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates FrameBase.setTextDistances in a practical document-editing workflow. It sets the distances, in twips, between the frame and the document's text. If a value is set to -1, it is not changed.

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

function configureTextDistances(frameBase, value) {
    frameBase.setTextDistances(
        value,
        function() {
            console.log("set text distances completed.");
        },
        onTxError
    );
}