Add HTML Header Footer to PDF in Zapier
Add HTML Header Footer to PDF is a Zapier action by PDF4me that stamps custom HTML markup into a PDF's header, footer, or both, across every page or a chosen range. Use it to brand invoices with a logo, add legal disclaimers to contracts, or insert document metadata without writing any code.
Authenticating Your API Request
To access the PDF4me Web API, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user.
Important Facts You Should Not Miss
Header, Footer, or Both. Selecting Both applies the same HTML Content to both regions; run the action twice for different header and footer content.(Exists but not shown) and you get a File is Empty error, pick the mapping option that returns full binary content from the previous step instead of a reference.
What Does This Action Do?
PDF4me Add HTML Header Footer to PDF creates professional headers and footers with custom HTML content directly within PDF documents. The HTML rendering engine supports rich formatting, dynamic content, responsive design, and professional styling. It is well suited to document branding, consistent formatting, and building professional documents with custom HTML-styled headers and footers that stay consistent across every page.
Key Features
- HTML Content Support: Create rich headers and footers using HTML markup with full CSS styling support
- Flexible Positioning: Add headers, footers, or both with customizable placement
- Dynamic Content: Support for dynamic HTML content integration from previous Zapier steps
- Professional Styling: Apply consistent branding and styling across all document pages
- Multi-Page Control: Add headers and footers to specific pages or across entire documents
- Margin Customization: Precise control over header and footer margins
- Automated Workflow Integration: RESTful API designed for automated workflows and enterprise system integration
How Do I Set Up the HTML Content Field?
Paste valid HTML markup with inline CSS into HTML Content. A two-column layout with a logo, document ID, title, author, and date on one side works well for invoices and reports; a centered single line works well for confidentiality footers.
- Two-column header
- Centered footer
<div style="width:100%; font-family: Segoe UI, Arial, sans-serif; color:#1a1a1a; padding:12px 18px 8px 18px; box-sizing:border-box;">
<table style="width:100%; border-collapse:collapse;">
<tr>
<td style="width:70%; vertical-align:top;">
<b>Document Type:</b> Invoice<br/>
<b>Document ID:</b> ABC-1761341735-1234<br/>
<b>Document Title:</b> Feedback and Product Analysis Report
</td>
<td style="width:30%; vertical-align:top; text-align:right;">
<b>Author:</b> PDF4me Team<br/>
<b>Date:</b> 2026-01-01<br/>
<b>Revision:</b> 2
</td>
</tr>
</table>
</div>
<div style="text-align: center; font-family: Arial, sans-serif; font-size: 9px; color: #666666;">
Confidential. For internal use only.
</div>
Parameters
Important: Parameters marked as Required must be provided for the action to run. Use the + button next to each field in Zapier to map data from previous steps.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| File | Required | Binary PDF content to add headers and footers to. Map from a previous trigger or action step (Dropbox, Google Drive, OneDrive, and similar apps all work). Ensure full file content is passed, not a reference. | 1. File |
| Specify File Name | Required | Output filename without extension. Map from the previous step, for example the source File Name field. | sample_3_page |
| Specify File Extension | Required | File extension for the output document. | .pdf |
| HTML Content | Required | The HTML markup for the header or footer, with optional inline CSS. Supports dynamic content, images, and responsive layout. | <div style="text-align:center;"><h3>Company Name</h3></div> |
| Location | Required | Where to apply the HTML Content. Choose Header, Footer, or Both. | Header |
| Pages | Required | Page indices as comma-separated values or ranges, for example "0, 1, 2-" or "1, 2, 3-7". Use all to apply to every page. | all |
| Skip First Page | Conditional | True skips adding the header or footer to the first page. Useful for cover pages and title sheets. | false |
| Margin Top in MM | Conditional | Margin above the header or footer, in millimeters, as a decimal value. | 10.0 |
| Margin Bottom in MM | Conditional | Margin below the header or footer, in millimeters, as a decimal value. | 10.0 |
| Margin Left in MM | Conditional | Left margin for the header or footer, in millimeters. | 15.0 |
| Margin Right in MM | Conditional | Right margin for the header or footer, in millimeters. | 15.0 |
What Does the Output Look Like?
The Add HTML Header Footer to PDF action returns the branded PDF ready for the next Zapier step.
- Table
- Workflow Usage
| Field | Type | What it contains |
|---|---|---|
File Content | Binary | The PDF file with the HTML header or footer applied, ready for download or further processing. |
File Url | String | Direct URL to the processed PDF. Map this into the next step, for example an Upload File action. |
File Name | String | Name of the output file without extension. |
Full File Name | String | Complete filename including extension. |
Advanced Workflow Integration
The output can be connected to other Zapier apps:
- File Storage: Google Drive, Dropbox, OneDrive for automatic file storage
- Email Integration: Gmail, Outlook, or email marketing tools
- Document Management: SharePoint, Confluence, or document management systems
- CRM Systems: Salesforce, HubSpot, or other CRM platforms
- Notification Systems: Slack, Teams, or SMS when processing completes
Typical Setups
img tag with a public logo URL plus company name and contact details in the HTML Content field gives every outgoing PDF a consistent letterhead.Practical Tips
- Keep CSS inline inside the HTML Content string; Zapier does not fetch external stylesheets.
- Set Pages to
allfor full-document branding, or a range like1, 2, 3-7to skip a cover page. - Use Skip First Page together with a range instead of manually excluding page 0 from the range string.
- Test the HTML block in the API Tester before wiring it into a live Zap.
- If File shows
(Exists but not shown), switch the mapping to the option that returns full binary content.
Cheat Sheet
Header, Footer, Both
all, or "1, 2, 3-7"
Millimeters (double)
File Url
Why Would I Add an HTML Header or Footer to a PDF?
Teams that generate PDFs from templates, exports, or scans often need consistent branding without editing every file by hand. A single Zap can watch a folder, apply a header or footer, and re-upload the branded file automatically, covering invoices, contracts, marketing materials, and educational content without manual formatting work.
How Does This Compare to Add Page Number or Add Margin?
| Action | Best for |
|---|---|
| Add HTML Header Footer to PDF | Rich branded headers or footers with logos, tables, and custom HTML/CSS layout |
| Add Page Number to PDF | Simple sequential page numbering without custom markup |
| Add Margin to PDF | Adjusting page margins without adding any visible content |