Client Side OCR

Drop a PDF. Get page text, a preview and real timing. Your PDF stays in this browser.

Loading OCR libraries and models. First load needs internet and can take a while...

Or drag a PDF here. Choose a file now; processing waits for the engine.


English/Latin print demo. OCR reads text, not structured invoice fields. Check totals and identifiers against the original.
How it works / React port

One HTML file, no build step. Pinned CDN scripts, OpenCV, PDF.js and PaddleOCR's mobile ONNX models download first. Models are about 21.5 MB combined; runtime and OpenCV add extra download size. Models use official PaddlePaddle mirrors on Hugging Face. The SDK bundle is embedded below to avoid a build step. No document upload endpoint is used. CDN hosts receive normal asset requests. Internet is needed to initialize; this is not a bundled offline app.

PDF.js renders pages; PaddleOCR runs detection and recognition with ONNX Runtime Web. Auto backend attempts WebGPU when usable, otherwise WASM. Single-thread WASM avoids cross-origin isolation requirements on a local file. A background worker keeps inference off the UI thread.

For React, initialize one engine once in a worker, reuse it for every page, and terminate on unmount. Keep pdfjs.getDocument(), page.render(), and the worker's ocr.predict() sequence. Production: self-host pinned scripts/models and measure on your actual invoices/devices.

Fast mode uses the existing PDF text layer when available and labels that result explicitly. Force OCR always processes rendered pixels. Speed depends on page density, resolution and hardware; there is no sub-second promise.

Sources: PaddleOCR browser SDK · PDF.js