
Build an Invoice Generator That Makes PDFs (Free Stack)
Freelancers pay monthly for invoicing they could own. Build a small invoice generator that outputs clean PDFs using free infrastructure.
Invoicing tools charge monthly for something fundamentally simple: take structured data, render it consistently, produce a PDF. If your needs are one business, a handful of clients, and sane numbering, an afternoon with an AI coding agent replaces the subscription with something you own outright.
Model the invoice before styling it
Start with the data, because everything else derives from it: your business details, client records, line items with quantity and rate, tax handling, notes, and payment terms. Ask your agent to sketch this as plain structures first and show you example output as text. Ten minutes here prevents the classic rework loop where layout gets rebuilt every time a field was forgotten. If you keep client lists in spreadsheets today, the pattern in turning spreadsheets into apps imports directly.
Connect the Claude or Codex you already pay for — the rest runs on workers that cost a fraction.
Download meshcode →Render with print styles, not a PDF library
The beginner move is reaching for a PDF-generation library immediately. Often unnecessary: browsers render HTML to PDF natively, and a page styled for paper — proper margins, page-break control, monospaced totals that align — prints identically for every client. Requesting "print stylesheet first" from your agent yields simpler, more maintainable code than most libraries produce. The technique generalizes to packing slips, quotes, and statements later.
Number invoices like an accountant, not an artist
Invoice numbering has two jobs: uniqueness and sequence. A scheme like year plus zero-padded counter survives audits and mental math alike; random IDs impress nobody at tax time. Store issued numbers durably so restarts don't reset counters, and never reuse a number even after deletion — void instead. These conventions cost nothing now and prevent genuine pain during your first inquiry from an accountant.
Add the delivery path clients actually use
A generated PDF helps only if it arrives. The pragmatic flow: generate on demand and download, then graduate to emailing automatically once volume justifies it. Either way, keep copies organized by client and date on your side — when a client asks for a copy from eight months ago, folder discipline beats search features. Payment tracking can stay manual until late; collecting money matters more than reconciling it elegantly. For turning this into a product others use, see monetizing a vibe-coded app.
Protect the template from drift
The quiet failure mode of self-built tools is divergence: you tweak the layout in June, tweak again in September, and suddenly old invoices render differently from new ones. Keep the template in version control, change it through commits, and regenerate any recurring invoice from current templates rather than editing PDFs by hand. Consistency across documents is a professional signal clients notice without naming it. Related reading on keeping changes safe: rollback safety for AI coding agents.
Know when to stop building
Scope discipline keeps this a weekend project: no multi-currency support until a client needs it, no recurring billing automation until manually resending hurts, no dashboard until you wonder about revenue unprompted. Invoicing succeeds as infrastructure precisely when it's boring. Every feature beyond boring moves maintenance onto your calendar forever.
The meshcode angle
An invoice generator is mostly iteration: render, eyeball the print preview, adjust, repeat. meshcode puts the agent session beside your live preview workflow so each cycle stays short, with diffs reviewable before anything lands. Bring your existing Claude Code or Codex subscription or run metered pay-as-you-go models — no seat fee required.
👉 Download meshcode — Mac, Windows
More from the blog
Build an Invoice Generator Without Coding
Stop wrestling with a spreadsheet template every time you bill a client. Here's how to build a simple invoice generator — line items, tax, a clean PDF — by describing it in plain language, with code you actually own.
How to Run Claude Code and Codex in Parallel on One Repo (Git Worktrees, Step by Step)
Run Claude Code and Codex on the same repository at once without them overwriting each other: one git worktree per agent, scoped briefs, and a safe merge. Step by step.
The Cheapest Way to Use Grok for Coding in 2026
The cheapest way to use Grok for coding depends on how you work: API tokens from about $1 per million, Cursor Pro at $20 with a dedicated Grok pool, or SuperGrok at about $30. What each route really costs.