# Javascript: Barcode.getAlignment Method

> Gets the alignment of the barcode image inside the control.

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

---

### Description

Gets the alignment of the barcode image inside the control.

### Syntax

```javascript
<void> Barcode.getAlignment(<RequestBarcodeAlignmentCallback> 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.getAlignment` in a practical document-editing workflow. It gets the alignment of the barcode image inside the control.

```javascript
function onTxError(error) {
    console.error("TX Text Control error:", error.msg);
    error.handled = true;
}

function inspectAlignment(barcode) {
    barcode.getAlignment(
        function(alignment) {
            if (!alignment) {
                console.warn("No barcode alignment was returned.");
                return;
            }
            
            console.log("get alignment result:", alignment);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: Barcode.getAdditionalText Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getadditionaltext-method/llms-full.txt)
- **Next:** [Javascript: Barcode.getAngle Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/barcode/getangle-method/llms-full.txt)
