HTML is the markup of the web, with native headings and tables. PDF is a frozen page layout with no heading structure a machine can rely on. calibre sits between the two, and this page says exactly what happens to an HTML file on the way to becoming a PDF one.
What runs when an HTML file becomes PDF
calibre the ebook-convert binary, on a machine we rent and watch. Your HTML file is uploaded once, calibre runs once, the PDF comes back, and neither file is kept. HTML to PDF is one of the 3649 pairs that engine was probed on with a real file, which is why it has a page here and why the pairs the probe could not prove do not.
What survives from the HTML into the PDF
The reading order and the chapter split of the HTML file. calibre rebuilds it as a book on the way to PDF, rather than as a pile of pages.
Images from the HTML file, placed inline in the PDF where the text refers to them.
What HTML to PDF costs you
Your page breaks, because an HTML file never had any. calibre reflows the text first and computes PDF pages from the result, so where a page ends is the engine decision and not the author one.
Everything the HTML file linked to. calibre runs with zero recursion here, so no link inside the HTML is followed. That is what stops an HTML file from a stranger pulling the server own files into the PDF.
If a model is going to read the PDF
Worth knowing before the PDF goes anywhere near an assistant: this is the wrong direction for that. A PDF is a set of positioned glyphs, and a model has to reconstruct the reading order before it can begin. If a machine rather than a person is going to read this HTML file, convert it to Markdown instead and skip the reconstruction entirely.
HTML to PDF, measured rather than promised
Running HTML to PDF against the real engine with a real file, calibre wrote 25,178 bytes of PDF in 1.9 seconds, machine otherwise idle. That is one HTML file on one day and not an average, which is why the number is given together with the file that produced it.
The HTML to PDF verdict was reached by a format signature, meaning at least four bytes unique to the format were found at the right offset. Which check was used matters, because they do not all prove the same thing, and a status code of 200 proves nothing whatsoever about whether the PDF file has anything inside it.
The same HTML file, sent somewhere else
Other outputs the probe measured out of an HTML file, so the cost of choosing PDF can be read against something. Sizes do not compare across engines, because each family was probed with its own HTML witness file.
HTML to MD: 371 bytes in under a tenth of a second, verified by a pandoc round trip.
HTML to DOCX: 10,277 bytes in 0.1 seconds, verified by a pandoc round trip.
HTML to EPUB: 5,027 bytes in 0.1 seconds, verified by a pandoc round trip.
HTML to TXT: 270 bytes in under a tenth of a second, verified by reading the text back.
HTML to RTF: 775 bytes in under a tenth of a second, verified by a pandoc round trip.
HTML to ODT: 7,629 bytes in 0.1 seconds, verified by a pandoc round trip.
Other ways into PDF, and what they measured
Among the published routes into PDF, HTML is the number 11 largest output of the 26 measured. The witness files differ, so this ranks the probe run and not your document.
TXT to PDF: 12,976 bytes in 1.8 seconds.
JPG to PDF: 4,232 bytes in under a tenth of a second.
PNG to PDF: 2,536 bytes in under a tenth of a second.
WEBP to PDF: 94,782 bytes in under a tenth of a second.
TIFF to PDF: 118,721 bytes in under a tenth of a second.
What we will not pretend about HTML to PDF
An HTML file over 50 MB is refused before the upload finishes rather than after it, so you do not wait for a rejection.
An HTML to PDF run that passes 120 seconds is killed, and the calibre process is killed with it. A run left behind would sit on one of the machine's two cores until somebody noticed.
The HTML file used to prove this pair was short. calibre is allowed 120 seconds and a long book can genuinely need all of them, so the PDF timing below is a measurement of one small file and not a guarantee about your thousand page one.
One HTML file at a time, chosen in the browser. There is nothing else to set up and nothing else on offer.
HTML to PDF: what people ask
What actually converts my HTML file to PDF?
calibre does it, the ebook-convert binary, on a machine we rent and watch. Not a browser trick and not somebody else service: the HTML file is uploaded once, calibre runs once, the PDF comes back, and neither file is kept afterwards.
How long does HTML to PDF take?
On the file the probe used, calibre took 1.9 seconds and wrote 25,178 bytes of PDF. That is one real measurement on one real HTML file, not an average and not a promise about yours: a larger HTML takes longer, and past 120 seconds the run is stopped.
What do I lose going from HTML to PDF?
The one to know about first: Your page breaks, because an HTML file never had any. calibre reflows the text first and computes PDF pages from the result, so where a page ends is the engine decision and not the author one.
Does the table of contents survive from HTML to PDF?
It does, as long as your HTML file has real headings rather than text that merely looks like headings. calibre builds the PDF contents from the heading structure it finds, and hand-formatted big bold lines are not a structure.
Is HTML to PDF free?
There is a free allowance every month, and one HTML to PDF conversion costs half a credit against it. When the allowance runs out the tool says so and stops, rather than quietly handing you a worse PDF.