I needed a rent receipt generator for a small landlord. The obvious answer was a SaaS: sign up, store tenants in a database, email PDFs. I built the opposite: one HTML file, no server, no build step, that prints a one-page PDF from the browser. Here is what that constraint taught me, and where it breaks.
The constraint
One file. Open it from disk or from a static host, it works the same.
No external scripts, no fonts from a CDN, no analytics. The file must work offline in 2036.
State survives a reload, but never leaves the machine.
The printed result must be a clean Letter or A4 page, not a screenshot of a web form.
Three things that did most of the work
1. Two layouts in one document, switched by @media print .
The page has a form on the left and the document on the right.…