DS Server

Javascript: ParagraphFormat.getKeepWithNext Method

Method|Introduced in 26.0

Description

Gets whether the paragraph is displayed on the same page as its following paragraph.

Syntax

<void> ParagraphFormat.getKeepWithNext(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives whether the paragraph is displayed on the same page as its following paragraph.

errorCallback

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

Examples

The following example demonstrates ParagraphFormat.getKeepWithNext in a practical document-editing workflow. It gets whether the paragraph is displayed on the same page as its following paragraph.

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

TXTextControl.paragraphFormat.getKeepWithNext(
    function(result) {
        if (result) {
            console.log("get keep with next is available.");
        } else {
            console.warn("get keep with next is not available in the current document state.");
        }
    },
    onTxError
);