HTML to PDF
Paste HTML or open an .html file, preview it at page width and download an A4 or Letter PDF. Useful for invoices, reports and email templates.
Paste HTML code or open an .html file
Scripts are removed. Images from other websites only appear if those sites allow it.
Preview at page width
Processed on this device. Nothing is uploaded.
How to use HTML to PDF
Simple steps to get your task done in seconds
Paste or open HTML
Paste code or open an .html file from your computer.
Check the preview
The preview shows exactly what will go on the pages.
Download
Convert and download the PDF.
How Client-Side HTML to PDF Conversion Works
ZapPebble transforms HTML code and web templates into formatted PDF documents directly within your browser. Your code is loaded into an isolated, sandboxed preview frame where CSS styling, tables, fonts, and inline graphics are rendered. You can export a paginated raster PDF using pdf-lib or launch the browser's native Print Tab for 100% crisp, selectable vector typography.
| Feature | Specification | Implementation Details |
|---|---|---|
| Input Methods | Direct Code Paste or .html File Upload | Supports modern HTML5, inline CSS stylesheets, and embedded base64 data URLs. |
| Security Isolation | Sandboxed Iframe | Restricts JavaScript execution inside the preview frame to prevent cross-site scripting. |
| Page Formats | A4 (650px content width), US Letter (672px) | Calculates responsive viewport widths with standard 0.75-inch margins. |
Practical Example: Generating a Professional Billing Invoice
You maintain an HTML invoice template for freelance web development with client billing information, itemized services, tax calculations, and payment terms in an HTML table.
- Quick PDF: Click "Download PDF" to generate a clean multi-page document in 2 seconds.
- Vector Print Tab: Click "Open Print Tab" to open the browser print dialog and save selectable vector text.
- Zero server calls: sensitive customer financial data stays on your machine.
Important Limitations & Recommendations
If your HTML references external image URLs that lack CORS (Cross-Origin Resource Sharing) headers, the browser may block them from the canvas. Use inline base64 data URLs for logos and signatures.
For pixel-perfect pagination with page-break controls (page-break-inside: avoid), use theOpen Print Tab option which fully respects browser print stylesheets.
Customer invoice details, tax numbers, and rate sheets remain strictly in browser RAM. Zero third-party telemetry is collected.
Related Document Tools
Frequently Asked Questions
Related tools
Other utilities that pair well with HTML to PDF
Word to PDF
Convert Word documents (.docx) to PDF in your browser, with headings, lists, tables and images.
PDF Editor
Add text, whiteout, highlights, drawings, signatures and images to any PDF.
JPG to PDF
Combine multiple JPG, PNG or WebP images into one PDF and download it. Nothing is uploaded.