Javascript: Barcode.getTextAlignment Method
Description
Gets a value indicating whether the barcode text and additional text is displayed below or above the barcode image.
Syntax
<void> Barcode.getTextAlignment(<RequestBarcodeTextAlignmentCallback> callback, [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| callback | Receives the alignment value. |
| errorCallback | Optional. Is called when the operation failed with an error. |
Examples
The following example demonstrates Barcode.getTextAlignment in a practical document-editing workflow. It gets a value indicating whether the barcode text and additional text is displayed below or above the barcode image.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function inspectTextAlignment(barcode) {
barcode.getTextAlignment(
function(alignment) {
if (!alignment) {
console.warn("No barcode text alignment was returned.");
return;
}
console.log("get text alignment result:", alignment);
},
onTxError
);
}