# Javascript: PageSize.setHeight Method

> Sets the page height of a document or document section.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: PageSize.setHeight Method
- **330 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pagesize/setheight-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pagesize/setheight-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pagesize/setheight-method/llms-full.txt

---

### Description

Sets the page height of a document or document section.

### Syntax

```javascript
<void> PageSize.setHeight(<number> height, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| height | The page height of a document or document section. |
| callback | Optional. Is called when the operation completed. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `PageSize.setHeight` in a practical document-editing workflow. It sets the page height of a document or document section.

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

TXTextControl.pageSize.setHeight(
    720,
    function() {
        console.log("set height completed.");
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: PageSize.getWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/pagesize/getwidth-method/llms-full.txt)
- **Next:** [Javascript: PageSize.setWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/pagesize/setwidth-method/llms-full.txt)
