TX Text Control .NET Server

Javascript: TextFrame.getInternalMargins Method

Method|Introduced in 28.0

Description

Sets the distances, in twips, between the text frame's border line and the text.

Syntax

<void> TextFrame.getInternalMargins(<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 TextFrame.getInternalMargins in a practical document-editing workflow. It sets the distances, in twips, between the text frame's border line and the text.

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

function inspectInternalMargins(textFrame) {
    textFrame.getInternalMargins(
        function(distances) {
            if (!distances) {
                console.warn("No distances was returned.");
                return;
            }
            
            console.log("get internal margins result:", distances);
        },
        onTxError
    );
}