# Javascript: TextChar.getBounds Method

> Gets the bounding rectangle of the character.

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

---

### Description

Gets the bounding rectangle of the character.

### Syntax

```javascript
<void> TextChar.getBounds(<RequestRectangleCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the bounding rectangle of the character. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `TextChar.getBounds` in a practical document-editing workflow. It gets the bounding rectangle of the character.

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

function inspectBounds(textChar) {
    textChar.getBounds(
        function(rect) {
            if (!rect) {
                console.warn("No rectangle was returned.");
                return;
            }
            
            console.log("get bounds result:", rect);
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [TextChar Object](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textchar/llms-full.txt)
- **Next:** [Javascript: TextChar.getChar Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/textchar/getchar-method/llms-full.txt)
