Skip to main content

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.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog →

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

HTML Content accepts full markup and inline CSS
Paste a full HTML block, such as a table with logo, document ID, author, and date columns, styled with inline CSS. Zapier passes the string through as-is, so keep styling inline rather than in a separate stylesheet.
Location controls where the HTML lands
Choose Header, Footer, or Both. Selecting Both applies the same HTML Content to both regions; run the action twice for different header and footer content.
File mapping needs full content, not a reference
If the File field shows (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.
PDF4me Add HTML Header Footer to PDF action in Zapier
The Add HTML Header Footer to PDF action inside a Zapier workflow, positioned after a file trigger and before an upload or storage step.

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.

<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>

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.

ParameterRequiredWhat it doesExample
FileRequiredBinary 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 NameRequiredOutput filename without extension. Map from the previous step, for example the source File Name field.sample_3_page
Specify File ExtensionRequiredFile extension for the output document..pdf
HTML ContentRequiredThe 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>
LocationRequiredWhere to apply the HTML Content. Choose Header, Footer, or Both.Header
PagesRequiredPage 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 PageConditionalTrue skips adding the header or footer to the first page. Useful for cover pages and title sheets.false
Margin Top in MMConditionalMargin above the header or footer, in millimeters, as a decimal value.10.0
Margin Bottom in MMConditionalMargin below the header or footer, in millimeters, as a decimal value.10.0
Margin Left in MMConditionalLeft margin for the header or footer, in millimeters.15.0
Margin Right in MMConditionalRight 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.

FieldTypeWhat it contains
File ContentBinaryThe PDF file with the HTML header or footer applied, ready for download or further processing.
File UrlStringDirect URL to the processed PDF. Map this into the next step, for example an Upload File action.
File NameStringName of the output file without extension.
Full File NameStringComplete filename including extension.

Typical Setups

Invoice and report branding
New File in Folder (Dropbox) triggers on a new PDF, Add HTML Header Footer to PDF stamps a header with Document Type, ID, Author, and Date, then Upload File saves the branded PDF back to a folder.
Legal and confidential footers
Contracts route through this action with Location set to Footer and a centered confidentiality notice, applied to every page before the file is sent for signature.
Company letterhead and logo
An 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 all for full-document branding, or a range like 1, 2, 3-7 to 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

Location values

Header, Footer, Both

Pages format

all, or "1, 2, 3-7"

Margins unit

Millimeters (double)

Output field

File Url

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?

ActionBest for
Add HTML Header Footer to PDFRich branded headers or footers with logos, tables, and custom HTML/CSS layout
Add Page Number to PDFSimple sequential page numbering without custom markup
Add Margin to PDFAdjusting page margins without adding any visible content

Common Questions

Can I add both a header and a footer in one step?+
Yes. Set Location to Both and the same HTML Content applies to both regions. For different HTML in each, run the action twice, once with Location set to Header and once with Location set to Footer. See the step-by-step Zapier walkthrough for a working example.
Can I use dynamic content from earlier Zap steps in the HTML?+
Yes. Map Zapier variables, such as a customer name or invoice number from a form, CRM, or spreadsheet step, directly into the HTML Content field. Build the HTML string in a Formatter step first if you need to combine several fields. Test snippets in the API Tester before wiring them into a live Zap.
What happens if the File field shows Exists but not shown?+
That label means Zapier is passing a file reference rather than full binary content. Select the mapping option that provides full file content, otherwise the action returns a File is Empty error. See Zapier's guide to working with files for background on how file fields are passed between steps.
Do I need Dropbox to use this action?+
No. Dropbox only appears in examples for New File in Folder and Upload File steps. The PDF4me action works with any Zapier trigger or action that supplies a PDF, including Google Drive, OneDrive, or SharePoint. See Connect PDF4me to Zapier for setup.
Why does inline CSS work better than a stylesheet in HTML Content?+
PDF rendering engines process the HTML Content string in isolation, so external stylesheet links are not fetched. Keep styles inline on each element, following the same approach documented in MDN's guide to the HTML style attribute, to guarantee consistent rendering across every page.
How is this different from adding a header/footer in Make or Power Automate?+
The underlying PDF4me parameters (HTML Content, Location, Pages, margins) are the same across platforms. Only the field mapping UI differs. See Add HTML Header Footer in Make or Add HTML Header Footer in Power Automate for the equivalent setup.

Same Task on Other Platforms

Get Help