# Javascript: PageBorder.setFirstPageOnly Method

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

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 26.0
- **Path:** TX Text Control .NET Server > Reference > JavaScript API > Javascript: PageBorder.setFirstPageOnly Method
- **383 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/setfirstpageonly-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/setfirstpageonly-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/setfirstpageonly-method/llms-full.txt

---

### Description

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

### Syntax

```javascript
<void> PageBorder.setFirstPageOnly(<boolean> firstPageOnly, [<EmptyRequestCallback> callback], [<ErrorCallback> errorCallback])
```

### Parameters

| Parameter | Description |
|---|---|
| firstPageOnly | Specifies whether the page border is drawn only on the first page of the 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 `PageBorder.setFirstPageOnly` in a practical document-editing workflow. It sets 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 configureFirstPageOnly(pageBorder) {
    pageBorder.setFirstPageOnly(
        true,
        function() {
            console.log("set first page only completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: PageBorder.setBottomLineWidth Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/setbottomlinewidth-method/llms-full.txt)
- **Next:** [Javascript: PageBorder.setLeftDistance Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/pageborder/setleftdistance-method/llms-full.txt)
