Skip to content
Practical AI Guides, Reviews & Tutorials Sunday, 26 July 2026

Project: A Browser Tool That Reformats Tax Invoices — No Server Needed

Sometimes a client or authority wants an invoice presented differently. In my case, invoices showing a “Deduction” line needed to be reissued in “(Less) Retention” format — same numbers, different presentation. Doing this by editing PDFs manually is slow and error-prone, and uploading financial documents to random online converters is a privacy risk I wasn’t willing to take. So the solution had one hard requirement: the documents must never leave the computer.

The approach: everything in the browser

The tool is a single HTML file. Open it in any browser, drop the invoice PDF onto the page, and two JavaScript libraries do the work locally: PDF.js (Mozilla’s library) renders the original invoice onto a canvas, the relevant section is redrawn in the new retention format, and jsPDF exports the finished document as a fresh PDF. No installation, no server, no upload — it works the same on any office PC, and IT has nothing to maintain.

The unexpected hard part: print quality

Getting a working prototype took an evening. Getting professional output took several more. Canvas rendering that looks fine on screen can print blurry, and text that fits at one size overflows at another. The fixes came iteratively: rendering at higher resolution before export, and scaling fonts based on the actual content length rather than fixed sizes. If you build document tools, budget more time for output polish than for core logic — the last 10% of visual quality is half the project.

Why this pattern is worth stealing

The “single HTML file” pattern deserves more attention in office environments. It needs no admin rights to run, no hosting, no subscription, and — critically for finance work — it’s private by construction, because the data physically stays on the machine. For any small document transformation your team does repeatedly, ask an AI assistant to build you one of these. Describe the input, describe the desired output, iterate on the details, and you end up with a tool that would have been a purchased product a few years ago.

Same numbers, new format, zero risk of transcription errors — and the original never leaves the desk.

Share with .. ..

Mohammed Sajjad

Chief Accountant by day, automation builder by night. Building self-hosted AI tools, VBA macros, web design and Python apps that make finance work less painful.

Newsletter

New Post

This the new post of today

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Related entries

  1. No. 064 Facebook Verified: Meta wants a video of your face, and this time it’s free · 5 min
  2. No. 063 Six weeks of running my own AI assistant on a small VPS · 4 min
  3. No. 063 The month-end close used to eat an afternoon. Now it’s a button. · 4 min
  4. No. 063 I tried to let an AI post to my own blog. It took four dead ends to get there. · 3 min
  5. No. 060 What Is an AI Agent? A Plain-English Explanation · 2 min

Leave a note

Your email address will not be published. Required fields are marked *