# Javascript: Page.getBounds Method

> Gets the bounding rectangle of the page, in twips, relative to the top of the document.

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

---

### Description

Gets the bounding rectangle of the page, in twips, relative to the top of the document.

### Syntax

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

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives the bounding rectangle of the page, in twips, relative to the top of the document. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `Page.getBounds` in a practical document-editing workflow. It gets the bounding rectangle of the page, in twips, relative to the top of the document.

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

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

---

## Nearby

- **Previous:** [Page Object](https://docs.textcontrol.com/ds-server/reference/javascript/page/llms-full.txt)
- **Next:** [Javascript: Page.getFooter Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getfooter-method/llms-full.txt)
