wkhtmltopdf embeds a headless WebKit rendering engine. When you provide an HTML file or URL, it renders the page exactly as a browser would — processing CSS, loading linked stylesheets, rendering web fonts, and applying JavaScript (within a short execution window). The rendered page is then paginated according to the specified paper size and exported as a PDF using WebKit's PDF print output pipeline. The result is indistinguishable from printing the page from a browser.
Convert HTML Files & Web Pages to PDF
Convert uploaded HTML files or public web page URLs to PDF using wkhtmltopdf/Pandoc. Styles, fonts, images, and page breaks are all faithfully rendered.
Drop your file here
or browse files
Up to 100 MB free • Outputs: PDF
Something went wrong. Please try again.
How to Use HTML to PDF
Convert your files in three simple steps — no software, no signup.
Upload HTML or Enter URL
Drop an .html file or paste a public URL. ZIP files with HTML + CSS + images are also accepted.
Set Page Options
Choose paper size (A4, Letter, Legal), orientation, and margins. Optionally add a header or footer.
Download PDF
The rendered PDF is pixel-accurate to a browser view. Download and verify before sharing.
Why Use HTML to PDF?
Full CSS & JS Support
wkhtmltopdf uses a WebKit rendering engine — CSS3, Google Fonts, responsive layouts, and basic JavaScript all render correctly.
URL-to-PDF Conversion
Enter any public URL and we fetch and render it as a PDF — great for archiving web pages or generating reports from web apps.
Headers & Footers
Add custom header and footer text including page numbers, date, and document title using wkhtmltopdf variables.
A4, Letter & Custom Paper
Choose from standard paper sizes or enter custom width and height. Portrait and landscape orientations supported.
Private & Secure
Uploaded HTML files and fetched pages are processed in isolation and deleted within 2 hours.
Print-Ready Output
The generated PDF respects CSS @page rules and print media queries, producing clean paginated output.
Supported Formats
All the formats you need, all in one place.
| Format | Description | Extension | Best Used For |
|---|---|---|---|
| HTML FILE | Uploaded .html file with inline or linked CSS | .html |
Invoice templates, letters, reports |
| HTML + ZIP | ZIP containing HTML + CSS + image assets | .zip |
Complex multi-asset HTML documents |
| URL INPUT | Public web page URL fetched and rendered | — |
Archive web pages, scrape reports |
| A4 PDF | 210×297mm standard international paper size | .pdf |
European documents, reports |
| LETTER PDF | 8.5×11in US standard paper size | .pdf |
US business documents |
| LANDSCAPE PDF | Wider-than-tall orientation | .pdf |
Wide tables, slides, dashboards |
| CUSTOM PDF | Specify exact width and height in millimetres | .pdf |
Receipts, labels, non-standard sizes |
Frequently Asked Questions
Who Uses HTML to PDF?
From everyday users to professionals — see how people rely on this tool every day.
Generate PDF Invoices from HTML Templates
Render an HTML invoice template with customer data and convert it to a pixel-perfect PDF for sending to clients.
Archive Web-Based Reports as PDF
Convert online dashboard pages or HTML report views to PDF for offline distribution, audit logs, or monthly records.
Preserve Web Pages as PDF
Archive news articles, wiki pages, or documentation pages as static PDF files that are immune to link rot.
Print HTML Email Templates
Convert an HTML email template to PDF to verify print rendering and share with non-email-client stakeholders.
Generate Form Letters from HTML
Render mail-merged HTML form letters to PDF for signed delivery, court filing, or compliance documentation.
Test Page Print Rendering
Convert any HTML page to PDF to preview exactly how CSS @media print rules will render before deploying print stylesheets.
HarmonyPal vs. Alternatives
See how we compare to desktop software and other online converters.
| Feature |
Our Tool HarmonyPal |
Adobe Acrobat | Other Online |
|---|---|---|---|
| Upload HTML file → PDF | |||
| URL → PDF (web page capture) | |||
| ZIP with HTML + CSS + images | |||
| Custom page size (A4, Letter, custom) | Limited | ||
| Header & footer with page numbers | |||
| CSS3 and Google Fonts support | Limited | Limited | |
| No watermark on output | |||
| Free to use |
Technical Specifications
Built on industry-standard open-source tools for maximum quality and reliability.
Limits & Restrictions
- Max file size: 100 MB (free)
- Input: .html file, .zip (HTML+assets), public URL
- Output: PDF (all paper sizes)
HTML to PDF with wkhtmltopdf: CSS Rendering, Page Breaks, and When to Use a Headless Browser Instead
Converting HTML to PDF requires a real browser rendering engine — not just a text parser. wkhtmltopdf uses WebKit, the same engine that powers Safari and early Chrome, to produce pixel-accurate PDF output.
How wkhtmltopdf Renders HTML
Controlling Page Breaks
Pagination in HTML-to-PDF is controlled by CSS. Use page-break-before: always (or the modern break-before: page) on any element to force a new PDF page. Use page-break-inside: avoid to prevent a table, image, or code block from being split across pages. The @page CSS rule sets margins, paper size, and orientation directly from your stylesheet, giving you precise control without needing to configure the conversion tool separately.
The @media print Rule
Browser-based HTML often has navigation menus, advertisements, and interactive elements that should not appear in print. The @media print CSS rule lets you hide these elements and apply print-specific styles. wkhtmltopdf honours @media print fully — add it to your stylesheet to hide sidebars (display: none), change font sizes, remove backgrounds, and apply print-optimised layouts. This is the recommended approach for HTML templates designed for PDF output.
Handling External Resources
When converting an HTML file, any linked CSS, images, and fonts referenced by relative paths must be included in the uploaded ZIP file. Absolute HTTPS URLs are fetched live during conversion. Google Fonts (loaded via <link> tags) work in URL-capture mode since the server can reach external URLs; for uploaded file mode, embed the font CSS and font files in the ZIP to ensure availability.
Limitations and When to Use Headless Chrome
wkhtmltopdf uses WebKit, which is based on an older version of the browser engine. It does not support modern CSS features like CSS Grid Level 2, container queries, or the latest CSS custom property syntax. Complex single-page applications built with React, Vue, or Angular require server-side rendering to produce static HTML before conversion. For these use cases, a headless Chrome/Puppeteer approach captures the full rendered page including all JavaScript-injected content. HarmonyPal uses wkhtmltopdf for static HTML and simple JavaScript pages.