Dev.to WebDev 🛠 Dev 👁 0 📖 1 min read

Building an Offline HTML5 Canvas Signature Pad & Printable Contract Studio in Vanilla JS (MIT)

Sending a clean Statement of Work (SOW) or service contract shouldn't require paying a monthly DocuSign or PandaDoc subscription—especially for solo developers and designers working with 2–5 clients a month. So I built

Sending a clean Statement of Work (SOW) or service contract shouldn't require paying a monthly DocuSign or PandaDoc subscription—especially for solo developers and designers working with 2–5 clients a month.

So I built ContractCraft, an offline-first freelance contract and e-signature generator that runs natively from index.html with zero backend and zero third-party libraries.

Engineering Highlights

  1. DPR-Safe HTML5 Canvas Signature Pad: Mouse and touch pointer events normalize coordinates against canvas.getBoundingClientRect() so strokes stay razor-sharp and export cleanly as embedded PNG data URLs inside the printable document.
  2. Dynamic Legal Clause Composition: Instead of editing brittle Word documents, smart toggles (IP transfer only on 100% payment, 50% upfront deposit, 2-round revision cap, 1.5% monthly late fee, 25% kill fee) dynamically compose crisp numbered clauses in real time.
  3. Vector A4 PDF Output via @media print: Browser-native printing hides editor controls and renders only #contract-sheet on A4 (@page { size: A4; margin: 0; }), suggesting <ContractRef>_<ClientName>.pdf automatically.

Try It Free (MIT Open Source)

It pairs directly with FolioDesk (my offline invoice & proposal studio: https://minhduy6868.github.io/foliodesk-lite/). If you want the full multi-template offline suite (5 contract templates + Invoice/Proposal CRM + Rate Calculator), grab the Pro studio here: https://payhip.com/b/fgPjn (code FOLIODESK40 gives 40% off).

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.