Engineered for developers
who care about security.
Implement client-side OCR or offline scripts in minutes. No API keys required, no rate limits, and zero tracking dependencies.
Offline sandboxed script.
Run the OCR parser locally on your client machine using JavaScript, Python, or standard terminal interfaces.
// 1. Install dependencies: npm install tesseract.js pdfjs-dist
import { createWorker } from 'tesseract.js';
import fs from 'fs';
async function performOcr(imagePath, langCode = 'eng') {
// Initialize worker locally
const worker = await createWorker(langCode);
// Extract optical text layout
const { data: { text } } = await worker.recognize(imagePath);
await worker.terminate();
return text;
}
performOcr('./scanned_sheet.png', 'eng')
.then(text => {
console.log('Extracted Text:\n', text);
})
.catch(console.error);
Integration specification.
Everything you need to know about implementing local OCR in your projects.
No Authentication Required
Unlike traditional OCR APIs which require complex key provisioning, PDF to OCR runs completely unauthenticated. The client-side WASM engine operates on the user's resources.
Model Cache Strategies
Tesseract.js uses IndexedDB to cache the .traineddata files. Users only download model payloads once. Cache language dictionaries on your own CDN.
Optimizing Resolution
When processing PDFs, render pages to canvas at a higher DPI (scale factor of 2.0 or 3.0). Rendering at 1.0 yields blurry characters.