HTML to PDF: freezing a web page
A snapshot that does not change
A web page can change tomorrow. A PDF made from it keeps showing what the page looked like today, which is exactly what you want for invoices, receipts, certificates and records.
Make the HTML self-contained
The best input is one file with its CSS inside and images embedded or local. Anything the page fetches from other websites, such as web fonts, remote images or scripts, may be missing from the PDF.
Controlling pages with CSS
A few lines of print CSS go a long way. An @page rule sets paper size and margins, and break-inside: avoid stops a table row or card from splitting between pages.
Saving a live website
This tool needs a file. Use your browser’s Save Page As to download the complete page, or choose Print and Save as PDF. Turn off headers and footers in the print dialog if you do not want the date and address in the margins.
Check before you send
Open the PDF and scroll through it. Look for cut-off tables, missing images and awkward page breaks, because they are easy to fix in the HTML and hard to fix in the PDF.
Generating invoices from templates? Keep one tested template and reuse it, so every PDF has the same layout.