DS Server

Javascript: Barcode.setBarcodeType Method

Method|Introduced in 28.0

Description

Sets the type of barcode that is rendered.

Syntax

<void> Barcode.setBarcodeType(<BarcodeType> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
value

The barcode type.

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.setBarcodeType in a practical document-editing workflow. It sets the type of barcode that is rendered.

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

function configureBarcodeType(barcode, value) {
    barcode.setBarcodeType(
        value,
        function() {
            console.log("set barcode type completed.");
        },
        onTxError
    );
}