Live HeaderFooter API
Design repeating page regions
Move through the document to inspect the current section. Create or activate its primary, first-page, and even-page headers and footers.
Current context
Section 1 of 1
Main text
DocumentSection 1Header / Footer stories
Section page regions
Each page variant can own a distinct header and footer text part.
Solid regions exist in this section. Dashed regions can be created with one click.
Choose a page regionSelect a header or footer in the page map to inspect or create it.
Selected story
Header
Header
Section-
Status-
Page variant-
Distance-
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Headers and footers belong to sections
A document can repeat one primary header and footer, add special first-page stories, or alternate even and odd pages. Every story is a formatted text part that can contain text, images, tables, fields, and page numbers.
Document stories
TXTextControl.headersAndFooters
Section stories
Section.headersAndFooters
Story types
TXTextControl.HeaderFooterType
Section linkage
HeaderFooter.getConnectedToPrevious / setConnectedToPrevious
How it works
TXTextControl.sections.getItem returns the section at the current input position. Its headersAndFooters collection contains up to six stories: Header, Footer, FirstPageHeader, FirstPageFooter, EvenHeader, and EvenFooter.
HeaderFooterCollection.getItem returns an existing story or null. When a dashed region is clicked, HeaderFooterCollection.add creates that type in the current section and the callback initializes its own selection with useful starter content.
HeaderFooter.activate moves the caret into that independent text part for normal editing. The headerFooterActivated, headerFooterDeactivated, and inputPositionChanged events keep the section map synchronized with the editor.
For documents with multiple sections, setConnectedToPrevious controls whether a story reuses the previous section's content. Disconnecting it creates an independently editable header or footer while preserving the other section settings.