DS Server

Javascript: ParagraphFormat.setTopDistance Method

Method|Introduced in 26.0

Description

Sets distance, in twips, between this and the previous paragraph.

Syntax

<void> ParagraphFormat.setTopDistance(<number> distance, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
distance

The distance, in twips, between this and the previous paragraph.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates ParagraphFormat.setTopDistance in a practical document-editing workflow. It sets distance, in twips, between this and the previous paragraph.

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

TXTextControl.paragraphFormat.setTopDistance(
    1440,
    function() {
        console.log("set top distance completed.");
    },
    onTxError
);