TX Text Control .NET Server

Javascript: ParagraphFormat.setBackColor Method

Method|Introduced in 26.0

Description

Sets the background color of a paragraph.

Syntax

<void> ParagraphFormat.setBackColor(<string> backColor, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
backColor

The background color of a 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.setBackColor in a practical document-editing workflow. It sets the background color of a paragraph.

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

TXTextControl.paragraphFormat.setBackColor(
    "#ffd54f",
    function() {
        console.log("set back color completed.");
    },
    onTxError
);