Convert an HTML file to PDF
A page saved from your browser, an export from a tool, an invoice template: drop the file, get a PDF.
How it works
- Drop your .html, .htm or .xhtml file, 10 MB max. on Free and 200 MB on Premium.
- Click Convert to PDF. We open the file in a browser and print it to PDF.
- Download your PDF. The source file and the generated file are deleted from our servers after one hour.
What you get
The PDF is the printable version of your page. The text stays text: it selects, copies and turns up in search. Links stay clickable, and your headings become bookmarks in the PDF.
Your stylesheet is honoured, print rules included. If your file declares a @page, its size and margins are the ones you wrote — A5 landscape with no margin, if that is what you ask for. Otherwise the PDF comes out A4 with a one-centimetre margin.
The page’s JavaScript runs: a table filled on load, a chart drawn by a library, a computed total are all in the PDF. We let the page settle before printing.
What your file must contain
The file is recognised by its content, not its name: it must start with <!doctype html> or <html>. A fragment starting straight with <div> or <table> is not recognised as a page — wrap it in <html><body>…</body></html> and it will go through.
Remote images, fonts and stylesheets referenced by a public address are loaded. Your file, however, cannot read any other file from your computer: it is alone on our servers. A folder of images saved next to the page (your browser’s “web page, complete”) is therefore not attached, and those images will be missing.
For a saved page to keep its images, prefer saving as “web page, single file” (the .mhtml format in Chrome and Edge) — or, more simply, convert its address directly with our web page to PDF tool.
Files we refuse, and why
The file renders no visible content: it is empty, or its stylesheet hides everything. We tell you rather than hand you a blank page.
The file is not an HTML page: a Word document, an image or an archive dropped here are recognised for what they are. Drop them on the home page, which sends them to the right converter.
The document exceeds 500 pages, or its layout takes more than a minute.
Privacy and security
The conversion runs on our OVHcloud servers in France. No US service is involved in the process — no CDN, no storage, no tracker. Your files are never indexed, analysed or reviewed. No result is cached: two conversions of the same file produce two independent PDFs.
Your page is opened in a sandboxed browser: it cannot read any other uploaded file, cannot write anywhere else, and has no access to internal networks. The information your file carries in its head, such as its title, is not copied into the PDF.
The source file and the generated PDF are deleted after one hour. If you create a share link, a copy of the file is kept for the period you chose (up to 7 days on Free and 30 days on Premium). You can delete the share at any time. conv2pdf is GDPR-compliant.
Frequently asked questions
Is my CSS honoured?
Yes, including your @media print and @page rules. It is the same rendering engine as a browser: what you would get with Ctrl+P is what you get here.
How do I choose the size or the margins?
In your file, with a @page rule: @page { size: A4 landscape; margin: 2cm }. We impose nothing beyond our default, A4 and one centimetre.
Does my JavaScript run?
Yes. We give the page a short delay to finish building itself, and print as soon as it is stable. An endless animation, on the other hand, is frozen at the moment of printing.
Why are my images missing?
Because they are in a folder next to your file, and only the file was sent to us. Images referenced by a public address are loaded fine.
What about a page saved from a site?
It converts, but the result depends on how it was saved. If you have the page address, our web page to PDF tool gives a better result: it loads the page whole.
Is the PDF text selectable?
Yes. The PDF is not an image of the page: it is a document whose text copies and searches.
Automate via the API
Converting in bulk or from your app? The same processing is available through our REST API — hosted in the EU (France), DPA on request.
curl -X POST https://api.conv2pdf.com/v1/convert/html-to-pdf \
-H "Authorization: Bearer cpdf_live_xxx" \
-F "file=@document.html"