Categories

PDF Header/Footer Snippets

Convert HTML to PDF with reusable logo, title, and date snippets

Render HTML to PDF and inject clean header/footer snippets.

Snippets supported:

  • Logo (image upload)
  • Title text
  • Date (ISO, locale, or custom)
  • Optional page numbers in the footer

Layout:

  • Left / center / right zones for each snippet
  • Works with custom margins for header/footer space

Example Results

1 examples

Header Footer Snippets

Header and footer snippet layout

header-footer-snippets-example1.pdf View File
View input parameters
{ "htmlContent": "\n<h1>Quarterly Report</h1>\n<p>This is a generated test document.</p>\n<div style=\"page-break-after: always;\"></div>\n<h2>Second Page</h2>\n<p>More sample content.</p>\n", "cssContent": "\nbody { font-family: Arial, sans-serif; }\nh1, h2 { color: #1f2937; }\np { font-size: 12pt; }\n", "headerTitle": "Quarterly Report", "footerTitle": "Internal", "showDateInHeader": true, "showPageNumbers": true }

Click to upload file or drag and drop file here

Maximum file size: 5MB Supported formats: image/png, image/jpeg, image/svg+xml, image/webp

Key Facts

Category
Document Tools
Input Types
textarea, select, checkbox, number, file, text
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

Easily convert your HTML content into professional PDFs with customizable header and footer snippets, including support for logos, document titles, dates, and automatic page numbering.

When to Use

  • When you need to generate professional reports or invoices from HTML templates.
  • When you want to add consistent branding like logos and titles to multi-page documents.
  • When you require automated date stamping and page numbering for formal documentation.

How It Works

  • Paste your HTML content and optional custom CSS into the editor.
  • Upload your logo and configure header/footer text, date formats, and page number settings.
  • Adjust page margins to ensure your content fits perfectly within the header and footer zones.
  • Click convert to generate and download your formatted PDF document.

Use Cases

Generating branded business invoices with company logos and contact footers.
Creating multi-page project reports with consistent headers and page numbers.
Converting web-based documentation into printable, professional PDF manuals.

Examples

1. Professional Business Invoice

Freelance Consultant
Background
The user needs to send a professional invoice to a client based on an HTML template.
Problem
The invoice lacks a company logo and formal page numbering, making it look unprofessional.
How to Use
Upload the company logo, set the header title to 'Invoice', and enable page numbers in the footer.
Example Config
headerTitle: 'Invoice', showPageNumbers: true, logoWidth: 100
Outcome
A clean, branded PDF invoice with the company logo at the top and page numbers at the bottom.

2. Quarterly Project Report

Project Manager
Background
A 20-page project report needs to be distributed to stakeholders.
Problem
The report requires a consistent date stamp and document title on every page for tracking purposes.
How to Use
Input the report HTML, enable 'Show Date in Header', and set the header title to 'Q3 Project Status'.
Example Config
headerTitle: 'Q3 Project Status', showDateInHeader: true, dateFormat: 'iso'
Outcome
A professional report with the project title and ISO-formatted date appearing consistently on every page.

Try with Samples

xml, html, markdown

Related Hubs

FAQ

Can I use my own CSS for the PDF?

Yes, you can input custom CSS to style your HTML content, including fonts, colors, and layout adjustments.

What image formats are supported for the logo?

You can upload PNG, JPEG, SVG, and WebP image files for your document logo.

Can I customize the date format?

Yes, you can choose between ISO format, your local system format, or provide custom text for the date.

How do I ensure the header and footer don't overlap my content?

Use the margin settings (Top, Bottom, Left, Right) to reserve sufficient space for your header and footer elements.

Does this tool support landscape orientation?

Yes, you can toggle the landscape checkbox to change the page orientation from portrait to landscape.

API Documentation

Request Endpoint

POST /en/api/tools/pdf-header-footer-snippets

Request Parameters

Parameter Name Type Required Description
htmlContent textarea Yes -
cssContent textarea No -
pageSize select No -
landscape checkbox No -
printBackground checkbox No -
marginTop number No -
marginBottom number No -
marginLeft number No -
marginRight number No -
headerEnabled checkbox No -
footerEnabled checkbox No -
logoFile file (Upload required) No -
logoWidth number No -
headerTitle text No -
footerTitle text No -
showDateInHeader checkbox No -
showDateInFooter checkbox No -
dateFormat select No -
customDateText text No -
showPageNumbers checkbox No -
waitUntil select No -
waitTime number No -

File type parameters need to be uploaded first via POST /upload/pdf-header-footer-snippets to get filePath, then pass filePath to the corresponding file field.

Response Format

{
  "filePath": "/public/processing/randomid.ext",
  "fileName": "output.ext",
  "contentType": "application/octet-stream",
  "size": 1024,
  "metadata": {
    "key": "value"
  },
  "error": "Error message (optional)",
  "message": "Notification message (optional)"
}
File: File

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-pdf-header-footer-snippets": {
      "name": "pdf-header-footer-snippets",
      "description": "Convert HTML to PDF with reusable logo, title, and date snippets",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=pdf-header-footer-snippets",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

Supports URL file links or Base64 encoding for file parameters.

If you encounter any issues, please contact us at [email protected]