Search docs/
Getting StartedPlugins

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.

Contact Us Today!

Installation

ionic cordova plugin add cordova-plugin-mobile-ocrnpm install @ionic-native/ocrnpm install cordova-plugin-mobile-ocrnpm install @ionic-native/ocrionic cap sync
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

See here.

Angular

import { OCR, OCRSourceType } from '@ionic-native/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));