DS Server

Javascript: ParagraphFormat.getTopDistance Method

Method|Introduced in 26.0

Description

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

Syntax

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

Parameters

ParameterDescription
callback

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

errorCallback

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

Examples

The following example demonstrates ParagraphFormat.getTopDistance in a practical document-editing workflow. It gets the 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.getTopDistance(
    function(result) {
        console.log("get top distance result:", result);
    },
    onTxError
);