Javascript: Barcode.setAlignment Method
Description
Sets the alignment of the barcode image inside the control.
Syntax
<void> Barcode.setAlignment(<BarcodeAlignment> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])Parameters
| Parameter | Description |
|---|---|
| value | The alignment value. |
| 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.setAlignment in a practical document-editing workflow. It sets the alignment of the barcode image inside the control.
function onTxError(error) {
console.error("TX Text Control error:", error.msg);
error.handled = true;
}
function configureAlignment(barcode) {
barcode.setAlignment(
TXTextControl.BarcodeAlignment.TopLeft,
function() {
console.log("set alignment completed.");
},
onTxError
);
}