# Javascript: PageBorder.getFirstPageOnly Method

> Gets whether the page border is drawn only on the first page of the section.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** DS Server > Reference > JavaScript API > Javascript: PageBorder.getFirstPageOnly Method
- **403 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getfirstpageonly-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getfirstpageonly-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getfirstpageonly-method/llms-full.txt

---

### Description

Gets whether the page border is drawn only on the first page of the section.

### Syntax

```javascript
<void> PageBorder.getFirstPageOnly(<RequestBooleanCallback> callback, [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| callback | Receives whether the page border is drawn only on the first page of the section. |
| errorCallback | Optional. Is called when the operation failed with an error. |

### Examples

The following example demonstrates `PageBorder.getFirstPageOnly` in a practical document-editing workflow. It gets whether the page border is drawn only on the first page of the section.

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

function inspectFirstPageOnly(pageBorder) {
    pageBorder.getFirstPageOnly(
        function(result) {
            if (result) {
                console.log("get first page only is available.");
            } else {
                console.warn("get first page only is not available in the current document state.");
            }
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: PageBorder.getBottomLineWidth Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getbottomlinewidth-method/llms-full.txt)
- **Next:** [Javascript: PageBorder.getLeftDistance Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/getleftdistance-method/llms-full.txt)
