TX Text Control .NET Server

Javascript: ParagraphFormat.setStructureLevel Method

Method|Introduced in 29.0

Description

Sets the structure level of a paragraph in the document. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document.

Syntax

<void> ParagraphFormat.setStructureLevel(<number> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
value

The structure level.

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.setStructureLevel in a practical document-editing workflow. It sets the structure level of a paragraph in the document. The level can be between 0 and 10. A level of 0 indicates that the paragraph belongs to the body of the document.

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

TXTextControl.paragraphFormat.setStructureLevel(
    1,
    function() {
        console.log("set structure level completed.");
    },
    onTxError
);