# Javascript: Barcode.getUpperTextLength Method

> Gets the maximum text length.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: Barcode.getUpperTextLength Method
- **319 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/barcode/getuppertextlength-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/barcode/getuppertextlength-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/barcode/getuppertextlength-method/llms-full.txt

---

### Description

Gets the maximum text length.

### Syntax

```javascript
<void> Barcode.getUpperTextLength(<RequestNumberCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the upper text length value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Barcode.getUpperTextLength` in a practical document-editing workflow. It gets the maximum text length.

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

function inspectUpperTextLength(barcode) {
    barcode.getUpperTextLength(
        function(result) {
            console.log("get upper text length result:", result);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: Barcode.getTextAlignment Method](https://docs.textcontrol.com/ds-server/reference/javascript/barcode/gettextalignment-method/llms-full.txt)
- **Next:** [Javascript: Barcode.saveImage Method](https://docs.textcontrol.com/ds-server/reference/javascript/barcode/saveimage-method/llms-full.txt)
