2.0.3 • Published 3 years ago

react-native-tesseract-ocr v2.0.3

Weekly downloads
74
License
MIT
Repository
github
Last release
3 years ago

Version Install Size Downloads PRs Welcome Commitizen friendly MIT License

All Contributors

Watch on GitHub Star on GitHub Tweet

This project uses:

NOTE: It is recommended to use react-native >= 0.60.0

Getting started

$ npm i react-native-tesseract-ocr --save

Mostly automatic installation

$ react-native link react-native-tesseract-ocr

Example

Check the example by yourself here

Usage

tessOptions

PropertyTypeDescription
allowliststringList of characters you want to recognize
denyliststringList of characters you DON'T want to recognize
levelLevelLevel of the tokens of the page hierarchy (only used in recognizeTokens)

Level can be one of the following values 'symbol' | 'block' | 'line' | 'paragraph' | 'word'

recognize

import TesseractOcr, { LANG_ENGLISH } from 'react-native-tesseract-ocr';

const tessOptions = {};
TesseractOcr.recognize(imageSource, LANG_ENGLISH, tessOptions);

recognizeTokens

import TesseractOcr, { LANG_ENGLISH, LEVEL_WORD } from 'react-native-tesseract-ocr';

const tessOptions = { level: LEVEL_WORD };
TesseractOcr.recognizeTokens(imageSource, LANG_ENGLISH, tessOptions);

useEventListener

import React, { useState } from 'react';
import { useEventListener } from 'react-native-tesseract-ocr';

function App() {
  const [progress, setProgress] = useState(0);
  useEventListener('onProgressChange', (p) => {
    setProgress(p.percent / 100);
  });

  // return ...
}

Contributing

How to contribute?

This is a commitizen friendly repository, so instead of creating commits using git commit, please use our custom CLI by running:

$ npm run cz

Contributors ✨

Thanks goes to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © jonathanpalma

This library wouldn't be possible without these amazing projects:

2.0.3

3 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago