DS Server

Javascript: Barcode.getForeColor Method

Method|Introduced in 28.0

Description

Gets the foreground color of the barcode control.

Syntax

<void> Barcode.getForeColor(<RequestStringCallback> callback, [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
callback

Receives the color as a CSS color string.

errorCallback

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

Examples

The following example demonstrates Barcode.getForeColor in a practical document-editing workflow. It gets the foreground color of the barcode control.

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

function inspectForeColor(barcode) {
    barcode.getForeColor(
        function(result) {
            console.log("get fore color result:", result);
        },
        onTxError
    );
}