# HeaderFooter Object

> Represents a header or footer in the document. A header or footer can be obtained through the TXTextControl.headersAndFooters property. The collection obtained through the TXTextControl.headersAndFooters property contains headers and footers which are common to all sections of the document. If a header or footer is added to this collection all sections of the document have the same header or footer. These headers and footers are connected, which means that changing the contents of such a header or footer also changes the content of all other section's headers or footers.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Object
- **Introduced:** 28.0
- **Path:** DS Server > Reference > JavaScript API > HeaderFooter Object
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/llms-full.txt

---

## On This Page

- [Description](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/#description)
- [Syntax](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/#syntax)
- [Examples](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/#examples)
- [Members](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/#members)

---

## In This Section

- [Javascript: HeaderFooter.activate Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/activate-method/llms.txt): Activates the this header or footer.
- [Javascript: HeaderFooter.deactivate Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/deactivate-method/llms.txt): Deactivates the this header or footer.
- [Javascript: HeaderFooter.getConnectedToPrevious Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/getconnectedtoprevious-method/llms.txt): Gets a value specifying whether the header or footer is connected with the header or footer of the previous section. If headers or footers are connected, they have always the same contents.
- [Javascript: HeaderFooter.getDistance Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/getdistance-method/llms.txt): Gets the distance, in twips, of a header or footer to the top or bottom of the page.
- [Javascript: HeaderFooter.getType Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/gettype-method/llms.txt): Gets the type of the header or footer.
- [Javascript: HeaderFooter.pageNumberFields Property](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/pagenumberfields-property/llms.txt): A collection of page number fields in the header or footer.
- [Javascript: HeaderFooter.setConnectedToPrevious Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/setconnectedtoprevious-method/llms.txt): Sets a value specifying whether the header or footer is connected with the header or footer of the previous section. If headers or footers are connected, they have always the same contents.
- [Javascript: HeaderFooter.setDistance Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/setdistance-method/llms.txt): Sets the distance, in twips, of a header or footer to the top or bottom of the page.

---

## Nearby

- **Previous:** [GetUserDictionaryInfoCallback Function](https://docs.textcontrol.com/ds-server/reference/javascript/getuserdictionaryinfocallback/llms.txt)
- **Next:** [Javascript: HeaderFooter.activate Method](https://docs.textcontrol.com/ds-server/reference/javascript/headerfooter/activate-method/llms.txt)
