PDF workflows
How to convert HTML to PDF in your browser
Learn how to turn HTML into a PDF with the print engine already built into your browser, without uploading the file anywhere.
Document summary
A practical guide to converting HTML to PDF with the browser print engine: previewing, print settings, and what the output keeps.
Key takeaways
- The browser print dialog is the conversion step
- Preview in a sandboxed frame so scripts cannot run
- Set margins, orientation, and scale in the dialog
Why use the browser print engine
Browsers already render HTML and CSS accurately, and their print dialogs can save any page as a PDF. Using that engine for conversion means the PDF matches what the browser displays, with no extra software.
The same engine handles margins, headers, footers, and page breaks through the standard dialog controls.
The conversion workflow
- 1
Open the HTML to PDF tool and paste the HTML you want to convert.
- 2
Review the sandboxed preview. Static HTML and inline CSS render normally; scripts and external requests are blocked.
- 3
Click "Print / Save as PDF" to open the browser print dialog.
- 4
Choose "Save as PDF" as the destination, adjust margins and scale, and save the file.
Print settings that matter
- Paper size: match the destination, usually A4 or Letter
- Margins: default margins are fine for most documents
- Scale: choose "Fit to page" when the content is slightly too wide
- Background graphics: enable when the design uses background colors
- Headers and footers: disable for clean documents or use for page numbers
What the preview cannot do
The preview runs sandboxed, so JavaScript, forms, and external fetches do not execute. Content that depends on scripts will look incomplete, and external images need network access to load.
For documents generated from Word or Markdown, the Word to PDF and Markdown to PDF tools may give more predictable results.
Frequently asked questions
Does the tool upload my HTML?
No. Rendering and printing happen entirely in your browser.
Why do my scripts not run in the preview?
The preview is sandboxed for safety. Static HTML and CSS render normally, but JavaScript is blocked.
How do I control page breaks?
Use the print dialog page settings, or add CSS print rules such as page-break-before to the HTML itself.
Does this work on mobile?
Mobile browsers support print-to-PDF on most platforms, though the dialog varies by browser.