DS Server

Javascript: TextFrame.setBorderWidth Method

Method|Introduced in 28.0

Description

Sets the width, in twips, of a text frame's border line. To alter the distance between the border line and the text, use the InternalMargins property. If this property is set to zero, the text frame has no border line.

Syntax

<void> TextFrame.setBorderWidth(<number> 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 TextFrame.setBorderWidth in a practical document-editing workflow. It sets the width, in twips, of a text frame's border line. To alter the distance between the border line and the text, use the InternalMargins property. If this property is set to zero, the text frame has no border line.

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

function configureBorderWidth(textFrame) {
    textFrame.setBorderWidth(
        1,
        function() {
            console.log("set border width completed.");
        },
        onTxError
    );
}