Menu

A rent receipt generator in one HTML file: print CSS, localStorage, and the bug I shipped
📰

A rent receipt generator in one HTML file: print CSS, localStorage, and the bug I shipped

DEV Community: css·Paperwork Kit·19 days ago
#R1nIN0AU
#devtocss#devto#dev#print#receipt
Reading 0:00
15s threshold

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.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.