Skip to main content

Headers & Footers

The header and footer objects define content that repeats on every page of the document. Both support text content with page-number tokens, a visual boundary rule, and the ability to skip specific pages.

Properties​

PropertyTypeDescription
contentarrayArray of content elements (paragraphs with inline formatting, SVG, columns, ...)
hrobjectHorizontal rule separating header/footer from body content. Uses the same hr definition as the content element.
skipPagesnumber[]Array of 1-based page numbers where this header/footer should not appear
offsetnumberPadding in points between the zone and the content that precedes it (default 8)

Content​

The content array works the same as the document's main content array. Each element supports $data resolution and inline formatting tags such as [b], [color], [tab], [image].

{
"header": {
"content": [
{ "p": "ShipForge[tab, 400, 0]Quarterly Report", "style": "headerStyle" }
]
}
}

Page numbers​

Page numbering uses the global tokens $global.PAGE and $global.NUMPAGES, resolved at render time inside any header or footer paragraph. See Globals for the full list.

{
"footer": {
"content": [
{ "p": "Page [b]$global.PAGE[/b] of $global.NUMPAGES", "style": "footerStyle" }
]
}
}

Shortcodes work inside the page-number paragraph just like any other content.

Boundary rule​

The hr property draws a horizontal rule between the header/footer area and the page body. It accepts the same properties as the standalone hr element.

{
"header": {
"content": [
{ "p": "ShipForge[tab, 400, 0]Quarterly Report", "style": "headerStyle" }
],
"hr": { "borderStyle": "solid", "height": 0.5, "color": "#CCCCCC" }
}
}

Any borderStyle supported by hr works here -- solid, dashed, dotted, double, groove, ridge, inset, outset, dashedFixed, or none.

Skip pages​

Use skipPages to suppress a header or footer on specific pages. Page numbers are 1-based -- commonly used to hide the header on a title page.

{
"header": {
"content": [ "..." ],
"skipPages": [1]
}
}

Complete example​

{
"header": {
"content": [
{ "p": "ShipForge[tab, 400, 0]Quarterly Report", "style": "headerStyle" }
],
"hr": { "borderStyle": "solid", "height": 0.5, "color": "#CCCCCC" },
"skipPages": [1]
},
"footer": {
"content": [
{ "p": "[color, #CC0000]CONFIDENTIAL[/color]", "style": "footerStyle" },
{ "p": "Page [b]$global.PAGE[/b] of $global.NUMPAGES", "style": "footerStyle" }
],
"hr": { "borderStyle": "dashed", "height": 0.4, "color": "#999999" }
}
}

In this example:

  • The header displays the company name on the right via [tab], separated from the body by a solid rule, and is hidden on the first page (title page).
  • The footer shows a red "CONFIDENTIAL" notice, a dashed boundary rule, and a page-number line with [b]...[/b] bolding around the current page number.