How to Convert HTML To PDF
Converting HTML to PDF is a core workflow for developers, marketers, and anyone who needs a permanent, printable snapshot of web content. Whether you're archiving a webpage, generating reports from a web app, saving receipts from online purchases, or creating documentation from HTML templates, PDF conversion captures the visual layout, links, and styling in a portable format.
Follow the step-by-step instructions below, then use the free tool directly — no registration or download required.
Open Tool →How to Convert HTML To PDF — Step by Step
Enter the URL or upload HTML
Navigate to SublimePDF's HTML-to-PDF converter. Paste a public URL to convert a live webpage, or upload an HTML file (with associated CSS and images) from your computer.
Configure page settings
Set the paper size (A4, Letter, or custom dimensions), orientation, and margins. For web pages designed for screens, Letter/landscape often produces the best fit.
Set rendering options
Choose whether to include backgrounds and colors, load external resources (images, fonts, stylesheets), and wait for JavaScript rendering if the page loads content dynamically.
Add headers and footers
Optionally insert page numbers, the source URL, dates, or custom text in the PDF header and footer areas. This is useful for documentation and archival purposes.
Convert and download
Click convert. The tool renders the full page — including content below the fold — into a properly paginated PDF document.
Pro Tips
- 💡 For JavaScript-heavy pages (React, Vue, Angular apps), enable the 'Wait for JS' option so dynamic content loads before the PDF is generated.
- 💡 Add @media print CSS rules to your HTML if you control the source — this lets you hide navigation, ads, and other elements that shouldn't appear in the PDF.
- 💡 For API-driven report generation, POST your HTML directly to SublimePDF's API endpoint instead of using the web interface.
- 💡 If the page has a dark background, enable 'Include backgrounds' to preserve the design. Disable it for a white-background, printer-friendly output.
Privacy & Security
All processing happens directly in your browser. Your files are never uploaded to any server — they remain on your device throughout the entire process. SublimePDF uses WebAssembly technology for fast, secure, client-side processing.
Works Everywhere
This tool works on any modern browser — Chrome, Firefox, Safari, or Edge — on desktop, tablet, or mobile. No software to install. PDF is an open ISO standard supported by all major platforms.
How to Convert HTML To PDF — FAQ
Does the converter run JavaScript on the page?
Can I convert a local HTML file?
Are hyperlinks preserved in the converted PDF?
How does the tool handle responsive layouts?
Related Guides
How to HTML To PDF Css Guide
CSS controls how your HTML-to-PDF output looks — page margins, fonts, and print-specific layouts. SublimePDF uses Chromium rendering, so standard CSS works plus @page rules for PDF control. Mastering print CSS lets you create pixel-perfect invoices, reports, and documents that look identical on screen and in the generated PDF.
How to HTML To PDF Fonts Guide
Typography makes or breaks PDF quality. SublimePDF's Chromium renderer supports web fonts, system fonts, and embedded fonts so your generated PDFs match your brand's typeface exactly. This guide covers loading custom fonts, handling fallbacks, and avoiding common rendering issues like missing glyphs, font substitution, and blurry text.
How to HTML To PDF Headers Footers
Headers and footers in HTML-to-PDF conversion add running elements to every page — page numbers, document titles, dates, and company logos. Unlike manually editing a finished PDF, API-based headers and footers are defined in your template and rendered automatically during generation. SublimePDF supports both CSS-based running headers and Chromium's native header/footer templates with dynamic variables.