OCR
This plugin attempts to identify and extract text from an image.
Please note: This plugin depends on the GoogleMobileVision pod which is referencing UIWebview, that has been deprecated by Apple.
Don't use this plugin in an app intended for App Store as you will get a review rejection from Apple: Deprecated API Usage — Apple will stop accepting submissions of apps that use UIWebView APIs
For more info, please see the following Github issue Google Mobile Vision relying on deprecated UIWebview.
https://github.com/NeutrinosPlatform/cordova-plugin-mobile-ocr
Stuck on a Cordova issue?
If you're building a serious project, you can't afford to spend hours troubleshooting. Ionic’s experts offer premium advisory services for both community plugins and premier plugins.
Installation
- Capacitor
- Cordova
- Enterprise
$ npm install cordova-plugin-mobile-ocr
$ npm install @awesome-cordova-plugins/ocr
$ ionic cap sync
$ ionic cordova plugin add cordova-plugin-mobile-ocr
$ npm install @awesome-cordova-plugins/ocr
Ionic Enterprise comes with fully supported and maintained plugins from the Ionic Team. Learn More or if you're interested in an enterprise version of this plugin Contact Us
Supported Platforms
- Android
- iOS
Usage
React
Learn more about using Ionic Native components in React
Angular
import { OCR, OCRSourceType } from '@awesome-cordova-plugins/ocr/ngx';
constructor(private ocr: OCR) { }
...
this.ocr.recText(OCRSourceType.NORMFILEURL, "file://path/to/image.png")
.then((res: OCRResult) => console.log(JSON.stringify(res)))
.catch((error: any) => console.error(error));