Ionic Framework w/ OCR scanner?

Hello, is it possible to integrate an OCR plugin to an Ionic app? I didnt found anything on the ngCordova plugin list.

If so, can you point me at the plugin?

I don’t think any JS OCR plugin may be compatible with Ionic.

Im looking into the same thing. I think I will have to go native for my app :frowning: Keep in touch if you find anything.

Also looking for an OCR plugin, any suggestions?

Havent had any luck.

did you guys try Ocrad.js?

and i found this demo with cam:

Anyone have any ideas on if Firebase + OCR with Cloudpipes is a good solution?

Soo… I was able to find two plugins one for each platform haha. This might get you in the right direction as it uses the native app’s power to do this. is the iOS one I was able to find and

is a link to how to use the android one.

I hope this gives you a good head start. Since it is cordova these should both be 100% compatible with Ionic, you just have to use the javascript calls and make sure that it stays in the angular run scope.

Good luck!

Wondering if you have any insight on performance for Tesseract on mobile?

I do not, it doesn’t look too hard if you got an example app going to test out a few different files. The tesseract is running native so that should really help. I’d expect a huge increase in speed using that over the javascript implementations.

What about, might be a solution, I will test it out with ionic see where I end…

1 Like

Thank you, do let us know!

Hello Edouard,

any news about your test ?

Hi Guys,

I made this: exmple.

Perhaps it can help you :smile:

tesseract ocr with android
what we did

  1. We have created the Cordova project.
  2. We have added tess-two in to Cordova project by using
  3. Updated the build.gradle (Android) dependency compile project(:libraries:tess-two) and updated the setting.gradle include ‘:libraries:tess-two’.
    using this URL
  4. build successfully but getting error at line
    TessBaseAPI baseApi = new TessBaseAPI();
    object creation.
    “no jni_onload found in /data/app-lib/” .
    like this

please advice…

main refer url

I have implemented this thing in ionic3 using npm packages.

command to install the package
sudo npm install tessetact.js

Using the plugin in ionic2 project.

import Tesseract from ‘tesseract.js’;

		.progress((progress) => {
			console.log('progress', progress);
		.then((tesseractResult) => {
			this.recognizedText = tesseractResult.text;
			console.log("this is the data we collected from image");
1 Like

I used this code and it worked perfectly when testing on a browser, however when running on my android device it shows a blank page, any idea on how i can handle this code on a real device will be of great importance?

1 Like


maybe you should show related code, otherwise it is nearly impossible to help you.

Best regards, anna-liebt.

Thanks for your response @anna_liebt , this is my full code.

import { Component } from ‘@angular/core’;
import { NavController, LoadingController, Events, ToastController, NavParams, AlertController} from ‘ionic-angular’;
import * as Tesseract from ‘tesseract.js’;

selector: ‘page-home’,
templateUrl: ‘home.html’
export class HomePage {

public loader: any;
public recognizedText: string;

constructor(public navCtrl: NavController, public navParams: NavParams, public toastCtr: ToastController, public loadingCtrl: LoadingController, public alertCtrl: AlertController) {
this.loader = this.loadingCtrl.create({
spinner: ‘ios’,
content: ‘Reading’

ionViewDidLoad() {

.progress((progress) => {
.then((tesseractResult) => {
this.recognizedText = tesseractResult.text;
console.log(“this is the data we collected from image”);

alerts (message: string) {
subTitle: message,
buttons: [‘OK’]


the code is bad readable because you doesn’t use the function from editor to embed code.

At the first look, it is maybe the path of your image. Think about that paths that are on browser are available not available at device.

Best regards, anna-liebt

@anna_liebt But the app does not even show the toolbar for the home page, i even removed the call for the text() function from ionViewDidLoad() {} and set a button to call the function but the button could not be displayed. So i think the issue occurs before the path is referenced.