๐ŸŒ

HTML to PDF

HTML to PDF renders a web page URL or a block of pasted HTML into a PDF with WeasyPrint, applying the page's CSS but not running any JavaScript.

About HTML to PDF

Useful when you need a fixed copy of something on the web: an invoice or booking confirmation shown only as a web page, an article you want to keep, a receipt, or documentation to read offline. It is also handy for generating a PDF from HTML and CSS you have written yourself, using print styles and page rules rather than a word processor.

The important limitation: JavaScript is not executed. WeasyPrint fetches the HTML and applies the CSS, and that is all. A modern single-page app that builds its content in the browser will therefore produce a blank or skeletal PDF. Pages behind a login, or ones that block automated requests, will not work either. Server-rendered pages and static HTML convert reliably.

How to html to pdf

  1. Paste a page URL, or switch to the box and paste HTML.
  2. Set the page size and orientation you want for the output.
  3. Click Convert to PDF and wait for the page to render.
  4. Download the PDF and check the content came through.

Why use this tool

URL or raw HTML

Point it at a live address or paste markup directly, which is the quicker route when you are testing print stylesheets or generating a template.

Real CSS support

WeasyPrint honours print stylesheets, @page rules, margins, page breaks and web fonts, so a well-styled document paginates the way you designed it.

Selectable text output

The result is real text and vector graphics rather than a screenshot, so the PDF stays searchable, copyable and small even for long pages.

Frequently asked questions

Why is my PDF blank or missing content?
Almost always because the page builds itself with JavaScript. WeasyPrint does not run scripts, so anything injected after load never appears. Check by viewing the page source: if the text you want is not in the raw HTML, it will not be in the PDF. Paste the rendered HTML instead.
Can I convert a page that needs a login?
No. The request is made from our server with no session, no cookies and no credentials, so anything behind a sign-in returns a login screen or an error. The workaround is to open the page in your browser, copy the rendered HTML and paste that instead.
Does it keep the page's styling?
Yes, CSS is applied, including print stylesheets and @page rules. Sites that ship a print stylesheet convert particularly well, since that is what a browser uses when printing. Layouts that depend on JavaScript for sizing, or on very new CSS features, may render differently from what you see on screen.
Can I set page size and margins?
Yes. Choose the page size and orientation before converting, and control margins from CSS with an @page rule if you are pasting your own HTML. For a URL, the site's own print styles take precedence where they define page geometry.
Is it free and is the page kept?
Free, no account, no watermark. The conversion runs on our own server rather than a third-party API, and both the fetched content and the finished PDF are deleted automatically within an hour. Pasted HTML is treated the same way and is never stored or indexed.