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

1

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.

2

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.

3

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.

4

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.

5

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?
Yes. SublimePDF renders pages in a full browser engine, executing JavaScript so dynamically loaded content, charts, and single-page app views are captured accurately.
Can I convert a local HTML file?
Yes. Upload your HTML file along with any CSS and image assets. The converter processes them together to render the page as it would appear in a browser.
Are hyperlinks preserved in the converted PDF?
Yes. Clickable links in the HTML remain clickable in the PDF. Internal anchor links and external URLs are both preserved.
How does the tool handle responsive layouts?
The page is rendered at a standard desktop viewport width by default. You can specify a custom viewport width if you want to capture the mobile or tablet layout instead.

Ready to get started?

Use SublimePDF's free tools right now.

Open Tool