# Javascript: ParagraphFormat.getPageBreakBefore Method

> Gets whether the paragraph is always displayed on top of a page.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: ParagraphFormat.getPageBreakBefore Method
- **369 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getpagebreakbefore-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getpagebreakbefore-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getpagebreakbefore-method/llms-full.txt

---

### Description

Gets whether the paragraph is always displayed on top of a page.

### Syntax

```javascript
<void> ParagraphFormat.getPageBreakBefore(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives whether the paragraph is always displayed on top of a page. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `ParagraphFormat.getPageBreakBefore` in a practical document-editing workflow. It gets whether the paragraph is always displayed on top of a page.

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

TXTextControl.paragraphFormat.getPageBreakBefore(
    function(result) {
        if (result) {
            console.log("get page break before is available.");
        } else {
            console.warn("get page break before is not available in the current document state.");
        }
    },
    onTxError
);
```

---

## Nearby

- **Previous:** [Javascript: ParagraphFormat.getLineSpacing Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getlinespacing-method/llms-full.txt)
- **Next:** [Javascript: ParagraphFormat.getRightIndent Method](https://docs.textcontrol.com/ds-server/reference/javascript/paragraphformat/getrightindent-method/llms-full.txt)
