DS Server

Javascript: Barcode.setText Method

Method|Introduced in 28.0

Description

Sets the text the barcode should encrypt.

Syntax

<void> Barcode.setText(<string> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
value

The encrypted text.

callback

Optional. Is called when the operation completed.

errorCallback

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

Examples

The following example demonstrates Barcode.setText in a practical document-editing workflow. It sets the text the barcode should encrypt.

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

function configureText(barcode) {
    barcode.setText(
        "INV-2026-0042",
        function() {
            console.log("set text completed.");
        },
        onTxError
    );
}