All Tools/Convert To PDF

HTML to PDF

Generate a PDF from HTML markup or an uploaded HTML file.

Available now
Malware scanning activeEvery uploaded file is checked before processing starts.
Maximum upload size: 100 MBOversized files are rejected before they enter the processing queue.
Manual download flowFiles stay on a download page until the visitor chooses to download them.
Ready to use

Convert HTML to PDF

Upload an `.html` file or paste raw HTML markup, then render it to PDF with headless Chrome.

Optional HTML fileor drag and drop hereBrowse files
Selected fileNo fileUsing pasted HTML only

Usage notes

Available
  • Accepts pasted HTML or an uploaded `.html` file
  • Rendered with headless Chrome
  • HTML uploads limited to 5 MB
  • Best for self-contained HTML, CSS, and inline assets

Render any webpage or HTML file to a pixel-accurate PDF

The web is built on HTML and CSS, but sharing a webpage by sending the HTML file rarely works — recipients need the exact browser, the fonts, the linked stylesheets, and the JavaScript all in the right places to see what you intended. A PDF short-circuits that: it captures the rendered output so what the recipient opens is exactly what you captured, frozen in place.

The OkFarsi HTML to PDF tool uses headless Chrome to render the page, which means the conversion pipeline behaves the same way your browser does. CSS selectors resolve. Web fonts load (assuming they're from a public source). Media queries apply — crucially, the tool respects the @media print stylesheet, so well-designed sites render their clean 'printer-friendly' version rather than the full navigation-heavy layout. Responsive layouts render at the page width you specify (A4, Letter, or custom).

There are two input modes. Upload mode takes an HTML file (plus referenced CSS and images if bundled) and renders it locally; this is the right choice for offline HTML, exported email templates, or generated reports where no external network is needed. URL mode fetches a live webpage and renders the current version; it's perfect for snapshotting a blog post, saving a receipt page, or archiving an article. URL mode honors the page's robots meta directives and only fetches what the live browser would.

How to convert HTML or a URL to PDF

  1. Pick the input mode

    Upload an HTML file when the content is already in hand, or paste a URL when you want a snapshot of a live page. URL mode is what you want for news articles, blog posts, documentation pages, and order receipts.

  2. Check that the page has a print stylesheet (optional)

    If you're converting a well-built website, its @media print CSS usually hides navigation, removes ads, and gives you a clean reading-oriented layout. Confirm this is what you want — most of the time it is. If you want the full visual version, disable 'use print stylesheet' in the options.

  3. Set the page size, orientation, and margins

    A4 portrait works for most text-heavy content. Landscape with narrower margins works better for wide tables, screenshots, or code listings. Custom sizes are useful for downloadable receipts where the source designed a specific page footprint.

  4. Configure background rendering

    Toggle 'print backgrounds' on if you want the page's background colors and images to appear in the PDF. Most blog posts and articles look better with backgrounds on. Plain text documents often look better with backgrounds off (and the PDF file is smaller).

  5. Run the conversion and verify

    Headless Chrome fetches (or loads) the page, waits for fonts and images, renders to PDF, and returns the result. Open the download and verify the layout — if fonts substituted or images are missing, it usually means they were behind authentication or a non-public CDN.

Common use cases

  • Snapshot a blog post or article

    Save a reference article to a permanent PDF so you still have it if the site changes or the page is taken down.

  • Generate receipts from web order pages

    Convert an order confirmation or booking page into a PDF for your expense tracker — captures the details exactly as they appeared.

  • Turn an email template into a shareable file

    Render an HTML email template (exported from your marketing tool) as a PDF to share internally for review without needing to send a test email.

  • Archive documentation pages

    Download a section of a documentation site as PDFs for offline reference or for merging into an internal knowledge-base bundle.

Privacy & security

Conversion runs inside isolated headless-Chrome instances that are rebuilt for each job, so pages never see each other. In URL mode, the fetch is performed from our infrastructure using a standard browser user-agent; we do not forward cookies, local storage, or authentication credentials, so pages behind login walls will render as the logged-out view or fail to load. Uploaded HTML files and generated PDFs are deleted from our servers shortly after your download. No crawled content is retained beyond the single conversion.

Frequently asked questions

Why doesn't my web-font render in the PDF?

Web fonts have to be reachable from our renderer. Most public fonts (Google Fonts, Adobe Fonts published via public CDNs) work fine. Fonts served from inside a firewall or behind authentication don't load, and the renderer substitutes the closest match. Host fonts publicly if exact typography matters.

Can I convert a page that requires login?

URL mode renders the page as a logged-out visitor sees it. For pages behind authentication, export the HTML from your browser (File → Save Page As → Web Page Complete), then upload the HTML bundle to the tool.

Does JavaScript run during the conversion?

Yes. Headless Chrome executes JavaScript and waits for page-load events before rendering to PDF. That means client-rendered content (React, Vue, Svelte apps) converts correctly, unlike simpler HTML-to-PDF tools that ignore JS.

What happens to ads and trackers on the page?

They load the same way they would in a regular browser visit. If you want a cleaner PDF, enable 'use print stylesheet' — most sites hide ads and navigation in their print CSS.

Can I control page breaks in the output?

Yes, if the source HTML uses the `page-break-before`, `page-break-after`, or modern `break-*` CSS properties, headless Chrome honors them. That's the right way to put specific content at the start of a new page.

Is my URL or HTML content stored?

No. The fetched content and the generated PDF are removed from our servers shortly after download. URL requests are logged only as operational metrics (timestamp, response code, response size) with no page-content retention.

Related Tools