@devinikhiya/react-native-tesseractocr
🧠 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'
Installation
npm install @devinikhiya/react-native-tesseractocr
Usage
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);
}
useEventListener('onProgressChange', (p) => {
setprogress(p.percent / 100);
});
TessData
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
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
License
MIT