Javascript: Barcode.getBarcodeType Method
Description
Gets the type of barcode that is rendered.
Syntax
<void> Barcode.getBarcodeType(<RequestBarcodeTypeCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the color string as a CSS color string. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Barcode.getBarcodeType in a practical document-editing workflow. It gets the type of barcode that is rendered.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectBarcodeType(barcode) {
barcode.getBarcodeType(
function(barcodeType) {
if (!barcodeType) {
console.warn("No barcode type was returned.");
return;
}
console.log("get barcode type result:", barcodeType);
},
onTxError
);
}