DS Server

Javascript: HeaderFooter.getDistance Method

Method|Introduced in 28.0

Description

Gets the distance, in twips, of a header or footer to the top or bottom of the page.

Syntax

<void> HeaderFooter.getDistance(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the distance, in twips, of a header or footer to the top or bottom of the page.

errorCallback

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

Examples

The following example demonstrates HeaderFooter.getDistance in a practical document-editing workflow. It gets the distance, in twips, of a header or footer to the top or bottom of the page.

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

function inspectDistance(headerFooter) {
    headerFooter.getDistance(
        function(result) {
            console.log("get distance result:", result);
        },
        onTxError
    );
}