TX Text Control .NET Server

Javascript: ParagraphFormat.setPageBreakBefore Method

Method|Introduced in 26.0

Description

Sets whether the paragraph is always displayed on top of a page.

Syntax

<void> ParagraphFormat.setPageBreakBefore(<boolean> pageBreakBefore, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
pageBreakBefore

Specifies whether the paragraph is always displayed on top of a 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 ParagraphFormat.setPageBreakBefore in a practical document-editing workflow. It sets whether the paragraph is always displayed on top of a page.

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

TXTextControl.paragraphFormat.setPageBreakBefore(
    true,
    function() {
        console.log("set page break before completed.");
    },
    onTxError
);