Render HTML as a PDF
Paste HTML into the editor or load an .html file, then render it to a PDF using html2canvas. Inline CSS works; external resources don't load.
Drop your file here
or click to browse
How it works
Paste HTML into the editor or load an .html file, then render it to a PDF using html2canvas. Inline CSS works; external resources don't load.
The tool renders your HTML to an offscreen canvas via html2canvas at 2x scale, then embeds that canvas as a JPEG page in a fresh PDF. Choose page size (A4 portrait, US Letter, or Fit to content). Inline styles work: <h1 style="...">, <p style="...">, classes you define in <style> blocks, all fine. What doesn't work, on purpose: external CSS files, web fonts, remote images, third-party scripts. The renderer is configured with useCORS: false, so no cross-origin fetches happen. This is the privacy-by-default trade-off: HTML that pulls in https:// resources will render without them. For local privacy-respecting rendering of a single page of styled content, it's a clean fit. Output filename is html.pdf.
How to use it
- Paste or load your HTML. Type into the editor or load an .html file — inline CSS and <style> blocks work.
- Pick a page size. Choose A4, US Letter, or Fit to content.
- Render. html2canvas draws the HTML at 2x scale locally; external fetches are blocked by design.
- Download. The rendered PDF downloads as html.pdf.
Frequently asked questions
- Why don't my external fonts or images load?
- By design. The renderer blocks cross-origin fetches so nothing about your HTML leaks to a third-party server. Inline base64 images and inline CSS work fine.
- Can I paginate long HTML across multiple PDF pages?
- Not yet. The current renderer puts everything on a single page (or fits the content to one page). Long HTML may overflow.
- Is my HTML uploaded?
- No. html2canvas renders inside your browser, pdf-lib builds the PDF locally.
- What CSS is supported?
- Most common CSS works (typography, layout, colors, borders, shadows). Some advanced features like CSS grid edge cases and certain transforms may not render exactly. Test on small HTML first.