Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@devinikhiya/react-native-tesseractocr

Devichand1140MIT0.1.10TypeScript support: included

@devinikhiya/react-native-tesseractocr is a react native module that allows you to use the Tesseract OCR library on Android and iOS.

react-native, ios, react-native-tesseractocr, tesseract, ocr, react-native-image-to-text, react-native-ocr, react-native-tesseract, react-native-tesseract-ocr, image-to-text, react-native-text-fetcher, react-native-text-reader, react-native-text-scanner, react-native-text-to-speech, react-native-text-to-speech, android

readme

@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.

video

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);
    }
  //progess listener for tesseractocr JOB
  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