How to

How to convert a local HTML file to PDF

Drop a local .html file in and it renders to PDF. This works well for self-contained pages: saved reports, static exports, generated documents. It does not work for pages whose content is fetched by JavaScript at runtime — for those, open the file in a tab and convert it as a page instead.

Takes about 1 min

Steps

  1. Check whether the file is self-contained

    Open it in a text editor. If you can see the actual content in the markup, converting the file works. If you see mostly a root div and script tags, the content is fetched at runtime.

  2. For a self-contained file, drop it in

    Open the extension, choose Upload Files, and drag the .html file into the drop zone.

  3. For a JavaScript-driven file, open it in a tab instead

    Then use "This Page", which converts the rendered result after the scripts have run.

  4. Convert

    Pick paper size and orientation, then convert.

Worth knowing

  • A blank or nearly-empty PDF from an HTML file almost always means the content loads via JavaScript. Open the file in a browser tab and convert the page.
  • External stylesheets and images referenced by relative path may not resolve when the file is converted on its own.

Questions

Why is my converted HTML file blank?

The page's content is almost certainly loaded by JavaScript, so the file itself contains only an empty shell. Open the file in a browser tab and use "This Page" instead, which captures the page after the scripts have run.

Related guides