TX Text Control .NET Server

Javascript: BarcodeCollection.getItemByName Method

Method|Introduced in 28.0

Description

Gets the barcode with the specified name.

Syntax

<void> BarcodeCollection.getItemByName(<RequestBarcodeFrameCallback> callback, [<ErrorCallback> errorCallback], <string> name)

Parameters

ParameterDescription
callback

Receives the requested barcode or null if no barcode with the specified name exists.

errorCallback

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

name

The barcode's name.

Examples

The following example demonstrates BarcodeCollection.getItemByName in a practical document-editing workflow. It gets the barcode with the specified name.

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

TXTextControl.barcodes.getItemByName(
    function(barcodeFrame) {
        if (!barcodeFrame) {
            console.warn("No barcode frame was returned.");
            return;
        }
        
        console.log("get item by name result:", barcodeFrame);
    },
    onTxError,
    "QuarterlyReport"
);