DS Server

Javascript: PageBorder.setLeftDistance Method

Method|Introduced in 26.0

Description

Sets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText.

Syntax

<void> PageBorder.setLeftDistance(<number> leftDistance, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
leftDistance

The distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates PageBorder.setLeftDistance in a practical document-editing workflow. It sets the distance, in twips, of the left border line either from the edge of the page or from the text, depending on the MeasureFromText.

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

function configureLeftDistance(pageBorder) {
    pageBorder.setLeftDistance(
        1440,
        function() {
            console.log("set left distance completed.");
        },
        onTxError
    );
}