🧠 This package leverages the power of OCR (Optical Character Recognition) technology, making it a breeze to extract text from images in your React Native apps.
it Uses - Tesseract4Android for android. Tesseract-OCR-iOS for ios (not implemented yet !)
📋 Key Features: You can
💫 recognize text from remote image(url) 🕸️
💫 recognize text with Camera 📷
💫 recognize text from gallery 📱
also support multi-language recognization.
For multi-language Just Use '@' between two languages Examples - for Hindi and english - 'hin@eng'
npm install @devinikhiya/react-native-tesseractocr
import TesseractOcr, { useEventListener } from '@devinikhiya/react-native-tesseractocr'; // ... try { const recognizedText = await TesseractOcr.recognize( path, 'eng', {}, ); console.log('text is', recognizedText); } catch (error) { console.log('error is', error); }
//progess listener for tesseractocr JOB useEventListener('onProgressChange', (p) => { setprogress(p.percent / 100); });
Strict requirement on language files existing in a referenced "tessdata" folder. For Android
Save TessData Files into - android/app/src/main/assets/tessdata
exaample - for the language english - android/app/src/main/assets/tessdata/eng.traineddata
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT