DS Server

Javascript: PageBorder.getTopDistance Method

Method|Introduced in 26.0

Description

Gets the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the {@link MeasureFromText}.

Syntax

<void> PageBorder.getTopDistance(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the {@link MeasureFromText}.

errorCallback

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

Examples

The following example demonstrates PageBorder.getTopDistance in a practical document-editing workflow. It gets the distance, in twips, of the top border line either from the edge of the page or from the text, depending on the {@link MeasureFromText}.

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

function inspectTopDistance(pageBorder) {
    pageBorder.getTopDistance(
        function(result) {
            console.log("get top distance result:", result);
        },
        onTxError
    );
}