A template can define a header and a footer, like a word processor. Both are repeated on every page of the generated PDF. The header sits in the page's top margin and the footer in the bottom margin.
They support text formatting, images, tables, links and merge fields (field expressions and function expressions). Merge fields are resolved against the same record as the body.
The header and footer are stored in the template definition (the Template.3bt file on the Template record). They are saved with each template version. Viewing an older revision in revision history shows its body only, like margins and settings. No new fields, permissions or layout changes are needed.
The top margin is the space available to the header and the bottom margin is the space for the footer. They are set in the Margins panel.
| Need | Do this |
|---|---|
| A taller header or footer | Increase the top or bottom margin. |
| A logo in the header | Size the image to fit within the top margin. |
| More space between the header and the body | Add space to the margin, not empty lines to the header. |
Keep content within the available margin to avoid clipping or overlap. Increase the margin or reduce the content if the output does not fit, and check a generated PDF with your selected engine.
| Place | Behaviour |
|---|---|
| Builder | Edited in the Header & Footer panel. The canvas shows the body only. |
| Submission app | Shown read-only above and below the document. When the first page differs, the first page header and footer are shown. |
| Redline app | Shown read-only above and below the editor. Collaborators cannot redline the header or footer. |
| Generated PDF | Repeated on every page, including audit trail pages. Page 1 uses the first page header and footer when Different first page is on. |
| Preview app | Shown on screen at the top and bottom of the document, and repeated on every page when printed. |
The header and footer are merged with Salesforce data when the document is opened for signing, at the same time as the body. The completed document (Document.html) keeps the merged header and footer. Regenerating its PDF later uses those stored values, not the current record values.
In a multi-user (redline) workflow, the header and footer are read from the template's latest saved version until the last signer completes the document. Changing a template's header or footer while a redline request is in progress changes it for that request.
Both the native and the external PDF engines support headers and footers in the page margins. Font and pagination differences between engines still apply. See PDF generation and Native PDF engine.
Documents completed before this feature was introduced have no header or footer and are unaffected. The PDF regeneration app keeps the header and footer of any document that has one.
| Symptom | Cause | Fix |
|---|---|---|
| Header is cut off in the PDF | Header is taller than the top margin | Increase the top margin or reduce the header content. |
| Header overlaps the first lines of the body | Insufficient space for the header | Increase the top margin. |
| Header missing from an old document's PDF | The document was completed before the header was added | Expected. Only documents completed after the header was saved carry it. |
| Merge field shows blank in the header | The field has no value on the record, or the user lacks field access | Check the record value and the running user's field-level security. |