# Javascript: PageBorder.setSurroundHeader Method

> Sets the whether the page border surrounds the section's header.

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

---

### Description

Sets the whether the page border surrounds the section's header.

### Syntax

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

### Parameters

| Parameter | Description |
|---|---|
| surroundHeader | Specifies whether the page border surrounds the section's header. |
| 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.setSurroundHeader` in a practical document-editing workflow. It sets the whether the page border surrounds the section's header.

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

function configureSurroundHeader(pageBorder) {
    pageBorder.setSurroundHeader(
        true,
        function() {
            console.log("set surround header completed.");
        },
        onTxError
    );
}
```

---

## Nearby

- **Previous:** [Javascript: PageBorder.setSurroundFooter Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/setsurroundfooter-method/llms-full.txt)
- **Next:** [Javascript: PageBorder.setTopDistance Method](https://docs.textcontrol.com/ds-server/reference/javascript/pageborder/settopdistance-method/llms-full.txt)
