# Page Object

> A Page object represents a formatted page of a document. Pages are numbered from the beginning to the end of the document beginning with 1. A document has at least one page. Each section of a document can have one or more pages depending on the text that is contained in the section. A section does not have to begin at the top of a page. Therefore more than one section can be on one page. This collection is only available, if the ViewMode has been set to PageView.

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

---

### Description

A Page object represents a formatted page of a document. Pages are numbered from the beginning to the end of the document beginning with 1. A document has at least one page. Each section of a document can have one or more pages depending on the text that is contained in the section. A section does not have to begin at the top of a page. Therefore more than one section can be on one page. This collection is only available, if the [ViewMode](https://docs.textcontrol.com/ds-server/reference/javascript/txtextcontrol/getviewmode-method/llms-full.txt) has been set to PageView.

### Syntax

```javascript
Page
```

### Examples

The following example demonstrates `Page` in a practical document-editing workflow. A Page object represents a formatted page of a document. Pages are numbered from the beginning to the end of the document beginning with 1. A document has at least one page. Each section of a document can have one or more pages depending on the text that is contained in the section. A section does not have to begin at the top of a page. Therefore more than one section can be on one page. This collection is only available, if the ViewMode has been set to PageView.

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

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

---

## In This Section

- [Javascript: Page.getBounds Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getbounds-method/llms-full.txt): Gets the bounding rectangle of the page, in twips, relative to the top of the document.
- [Javascript: Page.getFooter Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getfooter-method/llms-full.txt): Gets the footer of the page.
- [Javascript: Page.getHeader Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getheader-method/llms-full.txt): Gets the header of the page.
- [Javascript: Page.getImage Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getimage-method/llms-full.txt): Gets an image of the page's contents as in the specified format in screen resolution.
- [Javascript: Page.getLength Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getlength-method/llms-full.txt): Gets the number of characters of the page, including the page break character at the end of the page.
- [Javascript: Page.getNumber Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getnumber-method/llms-full.txt): Gets the page's number.
- [Javascript: Page.getNumberInSection Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getnumberinsection-method/llms-full.txt): Gets the page number relative to the beginning of the section the page belongs to.
- [Javascript: Page.getSection Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getsection-method/llms-full.txt): Gets the number, one-based, of the section the page belongs to.
- [Javascript: Page.getStart Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getstart-method/llms-full.txt): Gets the number (one-based) of the page's first character.
- [Javascript: Page.getTextBounds Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/gettextbounds-method/llms-full.txt): Gets the bounding rectangle of the page's text, in twips, relative to the top of the document.
- [Javascript: Page.select Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/select-method/llms-full.txt): Selects the text of the page.

---

## Nearby

- **Previous:** [Javascript: MisspelledWordInfo.text Property](https://docs.textcontrol.com/ds-server/reference/javascript/misspelledwordinfo/text-property/llms-full.txt)
- **Next:** [Javascript: Page.getBounds Method](https://docs.textcontrol.com/ds-server/reference/javascript/page/getbounds-method/llms-full.txt)
