Skip to main content
Version: v5

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?

Don't waste precious time on plugin issues.

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

$ npm install cordova-plugin-mobile-ocr 
$ npm install @awesome-cordova-plugins/ocr
$ ionic cap sync

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));