DS Server

Javascript: HeaderFooter.setDistance Method

Method|Introduced in 28.0

Description

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

Syntax

<void> HeaderFooter.setDistance(<Number> distance, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
distance

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

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates HeaderFooter.setDistance in a practical document-editing workflow. It sets 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 configureDistance(headerFooter) {
    headerFooter.setDistance(
        1440,
        function() {
            console.log("set distance completed.");
        },
        onTxError
    );
}