# Javascript: FrameBase.getBounds Method

> Gets the frame's bounding rectangle relative to the upper left corner of the document.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: FrameBase.getBounds Method
- **388 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getbounds-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getbounds-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getbounds-method/llms-full.txt

---

### Description

Gets the frame's bounding rectangle relative to the upper left corner of the document.

### Syntax

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

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the current property value. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `FrameBase.getBounds` in a practical document-editing workflow. It gets the frame's bounding rectangle relative to the upper left corner of the document.

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

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

---

## Nearby

- **Previous:** [Javascript: FrameBase.getAlignment Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getalignment-method/llms-full.txt)
- **Next:** [Javascript: FrameBase.getDescriptiveText Method](https://docs.textcontrol.com/ds-server/reference/javascript/framebase/getdescriptivetext-method/llms-full.txt)
