HTML Mail to PDF

Render email HTML content to PDF with preserved basic formatting using Puppeteer

Render email HTML to PDF with Chromium.

Highlights:

  • Supports raw HTML content or uploaded HTML file
  • Preserves basic mail layout: tables, images, inline styles
  • Optional message metadata header (subject, from, to, date)

Example Results

2 examples

Newsletter HTML Mail

Render HTML newsletter content to PDF with a mail header

libreoffice-html-mail-to-pdf-example1.pdf View File
View input parameters
{ "mailHtml": "<h2 style='color:#0f172a'>Q1 Product Update</h2><p>Hello team,</p><p>We shipped 3 major features this quarter.</p><table><tr><th>Area</th><th>Status</th></tr><tr><td>Platform</td><td>Stable</td></tr><tr><td>Growth</td><td>+18%</td></tr></table><p>Regards,<br/>Product Ops</p>", "subject": "Quarterly Product Update", "from": "[email protected]", "to": "[email protected]", "date": "2026-02-16 10:00", "pageSize": "A4", "landscape": false, "marginMm": 12 }

Raw Mail HTML on Letter

Convert a full HTML email document to Letter-size PDF

libreoffice-html-mail-to-pdf-example2.pdf View File
View input parameters
{ "mailHtml": "<!doctype html><html><body style='font-family:Arial'><div style='border:1px solid #d1d5db;padding:12px;border-radius:8px'><h3>Support Ticket Reply</h3><p>Hi Alex,</p><p>Your request has been completed. Please review the attached details.</p><ul><li>Ticket: #3241</li><li>Owner: Support Team</li><li>Status: Closed</li></ul><p>Thanks.</p></div></body></html>", "pageSize": "Letter", "landscape": false, "marginMm": 10 }

Click to upload file or drag and drop file here

Maximum file size: 30MB Supported formats: text/html

Key Facts

Category
Documents & PDF
Input Types
textarea, file, text, select, checkbox, number
Output Type
file
Sample Coverage
4
API Ready
Yes

Overview

Convert your email HTML content into professional, high-quality PDF documents while preserving essential layouts, tables, and inline styles using our reliable rendering tool.

When to Use

  • Archiving important email correspondence for long-term record keeping.
  • Generating printable reports or invoices from HTML-based email templates.
  • Standardizing email communications into a fixed document format for sharing.

How It Works

  • Paste your raw HTML code directly into the editor or upload an existing .html file.
  • Optionally add metadata such as subject, sender, recipient, and date to include a formal header.
  • Adjust document settings like page size, orientation, and margins to suit your layout requirements.
  • Click the convert button to render your HTML into a downloadable PDF file.

Use Cases

Creating PDF backups of critical business communications.
Converting marketing newsletter HTML into shareable PDF brochures.
Generating formal PDF receipts from automated order confirmation emails.

Examples

1. Newsletter HTML Mail

Marketing Manager
Background
The marketing team needs to archive a quarterly product update email as a formal PDF document.
Problem
The email contains complex tables and inline styles that need to be preserved in a static format.
How to Use
Paste the newsletter HTML into the input field and fill in the subject, sender, and date metadata.
Outcome
A clean, A4-sized PDF document featuring the email content with all tables and formatting preserved.

2. Support Ticket Export

Customer Support Agent
Background
A support ticket reply needs to be saved as a PDF for a customer's internal documentation.
Problem
The raw HTML response needs to be converted into a Letter-sized document with specific margins.
How to Use
Upload the HTML file of the ticket response and set the page size to Letter with 10mm margins.
Outcome
A professional PDF document ready for attachment or printing, maintaining the original support ticket layout.

Try with Samples

html, pdf, text

Related Hubs

FAQ

Can I upload my own HTML files?

Yes, you can upload any standard .html file directly to the tool for conversion.

Does the tool preserve my email's CSS styles?

The tool supports basic inline styles, tables, and images to ensure your email layout remains intact.

Can I add a header with sender and recipient information?

Yes, you can manually input the subject, from, to, and date fields to generate a structured message header.

What page sizes are supported?

You can choose between A4 and Letter page sizes to match your printing or filing needs.

Is there a limit to the file size I can upload?

The tool supports HTML file uploads up to 30MB.

API Documentation

Request Endpoint

POST /en/api/tools/libreoffice-html-mail-to-pdf

Request Parameters

Parameter Name Type Required Description
mailHtml textarea No -
htmlFile file (Upload required) No -
subject text No -
from text No -
to text No -
date text No -
pageSize select No -
landscape checkbox No -
marginMm number No -

File type parameters need to be uploaded first via POST /upload/libreoffice-html-mail-to-pdf 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-libreoffice-html-mail-to-pdf": {
      "name": "libreoffice-html-mail-to-pdf",
      "description": "Render email HTML content to PDF with preserved basic formatting using Puppeteer",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=libreoffice-html-mail-to-pdf",
      "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]