What it is

Tintenfisch is a PDF editor in the browser. Change text right inside the file, organize pages, comment, fill in and build forms, redact, sign and protect documents with a password. No account and no upload: documents are opened, edited and saved in the browser, and no server ever sees them.
Many online editors upload the file to a server, or edit by putting a white box with new text over the old one. I wanted neither. So I wrote the engine myself.
A PDF engine from scratch

The engine is a little over 25,000 lines of Rust and uses no third-party PDF library. It parses the file structure, interprets the content streams of each page and draws them itself. That includes the common font formats from Type 1 through TrueType to CID fonts, its own decoders for JPEG 2000, JBIG2 and CCITT fax, encryption and digital signatures.
It compiles to WebAssembly and runs in a Web Worker. The React interface keeps no document model of its own, it only sends messages to the engine and shows what comes back. Pages arrive as tiles, and a small scheduler in the worker handles what was just clicked first, then what is visible, then what comes next. Stale requests are dropped before they cost any time.
Text that stays text

The heart of it is editing text. Instead of painting over the old line, the engine finds the paragraph's text operators in the content stream, lays out the changed paragraph with the metrics of the original font, wraps it and writes new text operators back in the same place. The rest of the page stays as it was.
It gets tricky when an embedded font only carries the letters the original used. If a character is missing, Tintenfisch falls back to a matching open font and embeds only the glyphs it needs. Before it downloads a font for that, it asks.
Saving is usually an incremental update: the changes are appended to the file and the original stays untouched. Only when needed, for example when optimizing or after repairing a file, does the engine rewrite it completely. And redacting really removes the content from the file instead of hiding it under a bar.
Tested like a library
The engine has more than 300 tests. Golden tests render every test page and compare it pixel by pixel with a reference image, others check that four tiles put a page back together without a seam. A fuzz test types random edits into paragraphs and checks that the text lands exactly as typed and undoes completely.
The interface has Vitest tests that run the stores against a stand-in connection to the engine. Test files are only small PDFs built for the purpose, never real documents.
The stack
- Rust
- WebAssembly
- wasm-bindgen
- tiny-skia
- ttf-parser
- Web Worker
- React
- TanStack Router
- Zustand
- Tailwind
- Vite
- Vitest