A document title at the top, contact details at the bottom, or a “1 / 3” page label can all live in Header and Footer. Write the content once, and Tembuilder repeats it on the PDF sheets where that part is enabled.
Global provides the shared Header and Footer. Each page independently chooses Off, Inherit, or Customize for each part. Customized content belongs to that page and repeats on its physical PDF sheets.
1. Add a Header or Footer
Expand Global in Structure, then select Add global element → Header or Footer. If it already exists, select it directly in the list to edit it.
The toggle beside each Global item controls visibility for pages using Inherit. Turning it off preserves the shared content. Pages using Customize keep their own Header or Footer enabled.
Adding a new Header or Footer is available in the base variant. Switch back to the base if you are editing another variant and do not see Add global element.
2. Edit the repeated content
Select Header or Footer to open its HTML, CSS, Props, and Config tabs.
With an existing template, start in Props to update a company name, website, or label used by that template. For example, the invoice template has a footerWebsite prop for the website shown at the bottom of the page.
Use HTML to change content or structure, and CSS to change its presentation. In Header/Footer HTML, {{ props.propName }} reads a prop belonging to that part; {{ global.props.propName }} reads a prop from Global.
3. Set Header and Footer margins
Open Header → Config → Margin or Footer → Config → Margin. Enable margins and enter the four sides in mm. The Background section below sets the background of that Header or Footer.
These margins are separate from Content margin. To align a header logo with a table in the body, set the Header’s Left/Right margins to match the content area’s Left/Right margins.
Header/Footer height follows its content, including its own margins. Content margin → Top/Bottom provides the gap between that area and the main content. To increase the gap after a Header, change Content margin Top; to inset a logo inside the Header, change the Header’s margins or CSS.
4. Choose a mode for each page
Select a page in Structure → Config → Layout. Header and Footer each have their own mode.
| Mode | On the page | In Structure |
|---|---|---|
| Off | Hides this part. | Hides its page item. |
| Inherit | Uses the current Global version and follows its visibility. | Hides its page item. |
| Customize | Uses this page’s saved copy, including when the Global part is off. | Shows its page item. |
For a cover, choose Off for Header and Footer. Choose Inherit on pages that should follow the shared design. Use Customize when a page needs its own repeated content or configuration.
5. Insert automatic page numbers
Add this to Footer or Header HTML:
<span>{{ global.props.page_number }} / {{ global.props.total_pages }}</span>
These values are built into Global Props and filled by the system when the document is generated:
| Value | Content |
|---|---|
global.props.page_number |
The current PDF sheet number. |
global.props.total_pages |
The total PDF sheet count. |
You do not need to create another prop to store page numbers. For a three-sheet document, this example displays 1 / 3, 2 / 3, and 3 / 3.
{{ global.props.page_number }} /
{{ global.props.total_pages }}6. Customize a page’s Header or Footer
The first switch to Customize copies the effective Global HTML, CSS, props and configuration, including margins, mirroring and background. If no Global content exists, you start with an empty editable copy.
Expand the page in Structure. Its customized items appear before the content sections, ordered Header → Footer → sections. Select an item to edit its own HTML, CSS, Props or Config tab. Changes to this copy belong to the page. Later Global changes apply to pages using Inherit.
Switching to Off or Inherit keeps the customized copy and hides its item. Returning to Customize restores your edits, including after saving and reopening the template.
Each customized Header or Footer repeats across all PDF sheets produced by its logical page. In a variant, use the page’s Follow Base / Customize control to choose whether that variant owns the configuration. This is separate from the Header/Footer mode. Editing a page-owned copy in another variant creates an independent copy for that variant.