TX Text Control .NET Server

Javascript: ParagraphFormat.getStructureLevel Method

Method|Introduced in 29.0

Description

Gets 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.getStructureLevel(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the structure level.

errorCallback

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

Examples

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