Case study 06

A free PDF editor that runs entirely inside your browser tab.

Role
Solo engineer
Year
2026, live
Stack
Next 16, PDFium WASM, tesseract.js, Web Worker, Cloudflare Workers
Links
0cross-origin requests allowed while a document is open, asserted in browser tests1
27test files across unit and browser suites2
42commits on main3
0accounts, watermarks, page limits or paid tiers4
  1. README.md, "Is my PDF uploaded anywhere?"
  2. git ls-tree -r --name-only main, tests/**/*.test.ts and *.spec.ts
  3. git rev-list --count 044a3d6 (main on 2026-09-10) in the kimbelas/paperweight repo
  4. README.md, "Is it free?"

The problem

Most online PDF editors want your file on their server. For a signed contract, a visa form or a scan of an ID, that is the wrong place for it. And the free ones add a watermark or a page limit once you are done.

Paperweight edits real PDF text, forms and signatures with no server at all.

What I built

A static site whose PDF engine runs in your browser.

  • Edit existing text. Click a line and retype it. The font the document already embeds is reused when it has the glyphs, otherwise a metric-compatible substitute is used and the app says so.
  • Fill forms. Values go in through the form itself, so the filled form prints correctly and other software can still read it.
  • Remove and add signatures. Removal takes the signature out of the file rather than painting over it. Adding one works by drawing, typing or uploading a photo.
  • Read scans. On-device OCR with a confidence score per line.

Architecture

Page UINext 16, static exportWeb WorkerPDFium as WebAssemblyOCRtesseract.js, EnglishYour filestays in the tabCloudflare Workersstatic assets only

AI design

Paperweight has no language model, on purpose: sending a document to a model would break the one promise it makes.

  • On-device recognition. OCR runs in the browser. A scanned page has no text, only pixels, so the app reads it with a confidence score and calls the result a recognition guess.
  • Honest about what is an edit and what is a patch. Replacing text on a scan covers the line and draws over it. The interface says it is a patch, and that the covered pixels stay in the file.
  • Cover is not redaction. The app never uses that word for anything that leaves content in the file.

How it was built

The risky parts were proved first, as spikes inside the real project: text replacement on ten real documents, object removal with a render diff, font fallback, signature removal on a signed sample. A privacy check in CI fails if a single cross-origin request is made while a document is open. Deploys run from CI with wrangler.

Tradeoffs

  • Text edits never reflow. PDF has no paragraph model, so a longer line is condensed, then shrunk, then flagged as overflowing.
  • Editing a digitally signed document invalidates the signature. That is the mechanism working as designed, and the app tells you when the document opens.
  • Saving over the original needs the File System Access API. Outside Chromium it downloads a copy instead.
  • Printing and offline mode are not yet verified by hand in Firefox and Safari. The task list marks them open, because Playwright’s WebKit is not Safari.
WorkHire me