# Javascript: TXTextControl.BarcodeAlignment Enumeration

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

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Enumeration
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: TXTextControl.BarcodeAlignment Enumeration
- **506 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/barcodealignment-enumeration/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/barcodealignment-enumeration/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/barcodealignment-enumeration/llms-full.txt

---

### Description

Determines the alignment of the barcode image inside the control.

### Members

| Member | Description |
|---|---|
| TopLeft | Sets the alignment of the barcode to the top left of the control. |
| TopCenter | Sets the alignment of the barcode to the top center of the control. |
| TopRight | Sets the alignment of the barcode to the top right of the control. |
| MiddleLeft | Sets the alignment of the barcode to the middle left of the control. |
| MiddleCenter | Sets the alignment of the barcode to the middle center of the control. |
| MiddleRight | Sets the alignment of the barcode to the middle right of the control. |
| BottomCenter | Sets the alignment of the barcode to the bottom center of the control. |
| BottomLeft | Sets the alignment of the barcode to the bottom left of the control. |
| BottomRight | Sets the alignment of the barcode to the bottom right of the control. |

### Examples

The following example uses `TXTextControl.BarcodeAlignment.TopLeft` (sets the alignment of the barcode to the top left of the control.) in a document-editing workflow.

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

function applyBarcodeAlignment(barcode) {
    barcode.setAlignment(
        TXTextControl.BarcodeAlignment.TopLeft,
        function() {
            console.log("set alignment completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: TXTextControl.AutoGenerationType Enumeration](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/autogenerationtype-enumeration/llms-full.txt)
- **Next:** [Javascript: TXTextControl.barcodes Property](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/barcodes-property/llms-full.txt)
