Disclosure up front: I build ToolKnit, and this post is about how its PDF to Word converter got local OCR for scanned pages. I'm writing it because the hard parts were more about honesty and UX than about algorithms.
Constraint: the document never leaves the device
The goal was a DOCX from a text PDF or a scanned one, with no upload, no account and no AI key. That rules out sending pages to a cloud OCR API. Everything has to run in the tab.
1. Native text first, OCR second
If a PDF already has a text layer, OCR only adds errors. The engine reads text and drawing instructions first, using positions and font information to rebuild reading order, columns and tables. OCR only runs on pages that are really just images.
2. OCR components are installed once, on demand
OCR models and the runtime are much larger than the page itself. Loading them on every visit would hurt everyone who only converts text PDFs. Instead:
- Nothing heavy is loaded until you click Process.
- If components are missing, a first-run dialog asks to download them, verifies the files, then continues the job automatically.
- Verified components stay in a separate browser cache, so normal site updates don't evict them. If the browser clears storage, you may need to reinstall.
The privacy line is precise on purpose: only public processing components are downloaded. Your PDF, its password, the page images and the DOCX stay on the device. Ordinary visit statistics may still be sent, and the page says so.
3. Don't pretend everything is editable
This was the biggest product decision. Tools that claim "perfect conversion" leave users to find the broken tables later. We went the other way:
- Recognized tables become real Word tables only when the layout passes the engine's checks. Otherwise they stay as positioned text or an image.
- Complex figures and some formulas remain pictures.
- The default "keep original pages" mode prioritizes page geometry, which suits forms and reports. It is not the same as a freely reflowing Word document.
- After conversion, the counts describe what happened ("N tables rebuilt"), not a "correctness score".
4. Page selection before work starts
Big PDFs (up to 100 MiB can be opened) shouldn't be processed blindly. After reading, a page chooser opens automatically: process all pages, or pick pages from thumbnails. Confirming starts the conversion directly.
Lessons
- Only show a progress bar if it is driven by real work, and let users cancel.
- Put limits on the page, not in a support doc.
- Give people an honest alternative. If you just need the page unchanged, PDF to Image is the better tool, and we link to it.
If you've shipped in-browser OCR, I'd like to hear how you handled model size and caching.
Drafted with AI assistance; technical claims checked against the live tool page.

