Skip to content
BabaPDF
Convert to PDF

HTML to PDF

Turn an HTML file or pasted markup into a PDF.

loading tool…

processed in your browser · 0 KB uploaded
HTML to PDF · overview

What HTML to PDF does

HTML to PDF renders an HTML file or pasted markup in your browser and captures it as a paginated PDF document.

HTML to PDF is genuinely harder in a browser than it looks, and it is worth being straight about why. Converting a page from a URL means fetching that page — and a browser is not allowed to fetch arbitrary websites on your behalf, because of the security rule (CORS) that stops one site reading another. Every service that accepts a URL is doing that fetch on its own servers. BabaPDF has no servers, so it accepts the part that genuinely is possible: an HTML file you upload, or markup you paste.

Your HTML is laid out by your own browser in an isolated frame, then captured and sliced across pages. It works best on self-contained HTML — invoices, exported reports, templates — where the styling is inline and the images are embedded.

Step by step

How to use HTML to PDF

  1. Provide your HTML

    Upload a saved .html file, or switch to the Paste tab and drop in markup directly.

  2. Check the preview

    The rendered page appears in a preview frame so you can see what will be captured.

  3. Choose a page size

    Pick A4 or Letter. Taller content is sliced across as many pages as it needs.

  4. Convert, or print instead

    Convert to PDF captures the page as an image. For selectable text, use Print to PDF and choose "Save as PDF" in your browser's print dialog.

Details & limits

HTML to PDF: details and limits

  • You cannot convert a live web page by URL, and no browser-only tool can — see the explanation above. Save the page to an .html file first and upload that.

  • The captured PDF is an image of the page, so its text is not selectable or searchable. The "Print to PDF" button uses your browser's own print engine instead and does produce real vector text.

  • Scripts are never executed, for security — your uploaded HTML cannot run code. That also means anything drawn by JavaScript will not appear in the output.

  • Images, fonts and stylesheets loaded from other websites may be blocked and silently skipped. Self-contained HTML with inline CSS and embedded images converts most reliably.

HTML to PDF · help

HTML to PDF: frequently asked questions

No — and that is a real limit rather than an oversight. BabaPDF has no server, so fetching another website would have to happen from your browser, which the web's security rules (CORS) block for sites that have not opted in. Services that accept a URL do that fetching on their own servers. You can upload a saved .html file or paste HTML source instead.

Go deeper

Guides

Next steps