DS Server

Javascript: ParagraphFormat.setKeepWithNext Method

Method|Introduced in 26.0

Description

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

Syntax

<void> ParagraphFormat.setKeepWithNext(<boolean> keepWithNext, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
keepWithNext

Specifies whether paragraph is displayed on the same page as its following 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.setKeepWithNext in a practical document-editing workflow. It sets whether 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.setKeepWithNext(
    true,
    function() {
        console.log("set keep with next completed.");
    },
    onTxError
);