Javascript: BarcodeCollection.getItemByName Method
Description
Gets the barcode with the specified name.
Syntax
<void> BarcodeCollection.getItemByName(<RequestBarcodeFrameCallback> callback, [<ErrorCallback> errorCallback], <string> name)Parameters
| Parameter | Description |
|---|---|
| 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"
);