Most web PDF editors don't actually edit text. They just slap a white box over the page and put a new text layer on top. Works fine until you try to select text, inspect the file, or edit a multi-line paragraph without colliding with everything below it.
The reason is pretty simple: PDFs don't have paragraphs or lines, just low-level drawing ops placing glyphs at x/y coordinates. When I started building OasisPDF I figured I could just use existing JS libs or compile PDFium to WASM and let it handle mutations. Turns out JS libs don't have the layout model for real reflow, and using PDFium to regenerate content streams ended up corrupting untouched parts of complex files.
So I split them completely. PDFium runs in workers strictly as a read-only rasterizer to give me page bitmaps, and I composite those in WebGPU so big files don't kill the tab. All the actual parsing, layout reconstruction and writing is custom TypeScript that only touches the edited parts and leaves the rest of the file alone. Also means when you delete text or images and save, they actually get stripped out by default instead of sitting around in incremental history.
If you wanna test it on a messy PDF, it's at oasispdf.com (there's a sample page on the front if you don't have a file handy, everything runs locally in the browser). Needs a recent desktop Chrome or Edge right now because of WebGPU and some newer browser APIs, no Safari/Firefox/mobile yet. Let me know if you find a file that breaks it.
