DS Server

Javascript: Selection.getBold Method

Method|Introduced in 26.0

Description

Gets the bold attribute of the selected text.

Syntax

<void> Selection.getBold(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the bold attribute of the selected text.

errorCallback

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

Examples

The following example demonstrates Selection.getBold in a practical document-editing workflow. It gets the bold attribute of the selected text.

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

TXTextControl.selection.getBold(
    function(result) {
        if (result) {
            console.log("get bold is available.");
        } else {
            console.warn("get bold is not available in the current document state.");
        }
    },
    onTxError
);