DS Server

Javascript: Barcode.setTextAlignment Method

Method|Introduced in 28.0

Description

Sets a value indicating whether the barcode text and additional text is displayed below or above the barcode image.

Syntax

<void> Barcode.setTextAlignment(<BarcodeTextAlignment> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])

Parameters

ParameterDescription
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.setTextAlignment in a practical document-editing workflow. It sets 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 configureTextAlignment(barcode) {
    barcode.setTextAlignment(
        TXTextControl.BarcodeTextAlignment.Bottom,
        function() {
            console.log("set text alignment completed.");
        },
        onTxError
    );
}