- README.md, "Is my PDF uploaded anywhere?"
- git ls-tree -r --name-only main, tests/**/*.test.ts and *.spec.ts
- git rev-list --count 044a3d6 (main on 2026-09-10) in the kimbelas/paperweight repo
- 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
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.