# Javascript: Barcode.getTextAlignment Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: Barcode.getTextAlignment Method
- **408 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/gettextalignment-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/gettextalignment-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/gettextalignment-method/llms-full.txt

---

### Description

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

### Syntax

```javascript
<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.

```javascript
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
    );
}
```

---

## Nearby

- **Previous:** [Javascript: Barcode.getText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/gettext-method/llms-full.txt)
- **Next:** [Javascript: Barcode.getUpperTextLength Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getuppertextlength-method/llms-full.txt)
