Images run through a persistent tesseract.js worker (deu+eng
tessdata_fast), PDFs through Obsidian's bundled pdf.js — both in idle
time on a serial deduplicating queue, feeding a low-weight
extractedText field. Results live in a synced ocr-cache.json keyed by
path+mtime+size+langs, so no device ever recognizes a file twice.
The ~7 MB runtime (worker, WASM core, language models) is not bundled:
a fixed ocr-assets-v1 release (built by the new ocr-assets workflow)
is downloaded once into the plugin dir when the user enables OCR, then
everything is offline. Dev builds copy the same files from assets/ocr
(npm run fetch-ocr-assets) into the test vault. Settings gain the OCR
toggle, language choice, and PDF switch; mobile degrades gracefully.
Verified end-to-end: a rendered test image round-trips through the
bundled models as "Angebot für die Küche / Rechnung Nr. 4711".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>