# Javascript: Barcode.setUpperTextLength Method

> Sets the maximum text length.

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

---

### Description

Sets the maximum text length.

### Syntax

```javascript
<void> Barcode.setUpperTextLength(<number> value, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| value | The upper text length. |
| 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.setUpperTextLength` in a practical document-editing workflow. It sets the maximum text length.

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

function configureUpperTextLength(barcode) {
    barcode.setUpperTextLength(
        1,
        function() {
            console.log("set upper text length completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: Barcode.setTextAlignment Method](https://docs.textcontrol.com/ds-server/reference/javascript/barcode/settextalignment-method/llms-full.txt)
- **Next:** [BarcodeCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/barcodecallback/llms-full.txt)
