NeutrinosPlatform / cordova-plugin-mobile-ocr

A cordova plugin that can accept image URI or Base64 data and returns the text present in the image as string without need for network. You can also try :- https://github.com/NeutrinosPlatform/cordova-plugin-ml-text
MIT License
49 stars 30 forks source link

ERROR TypeError: Object(...) is not a function at OCR.recText #32

Open JrLouis1101 opened 4 years ago

JrLouis1101 commented 4 years ago

Hi, I'm trying to use ocr plugin in my ionic 3 project, but when I call recText console returns this error: ERROR TypeError: Object(...) is not a function at recText.

I used this commands to install the plugin: ionic cordova plugin add cordova-plugin-mobile-ocr npm install @ionic-native/ocr

my function:

readTag(){ this.ocr.recText(OCRSourceType.BASE64, this.imageText) .then((res: OCRResult) => { console.log(JSON.stringify(res.blocks.blocktext)); this.ocrTextHTML = JSON.stringify(res.blocks.blocktext); }) .catch((error: any) => console.error(error));

}

Does someone know how to fix this? thanks for any help.

Obs: I made the same example in ionic 5 project and it worked.

ChrisTomAlx commented 4 years ago

Hey @JrLouis1101

You will probably have to raise this with the ionic guys. I don't maintain the ionic documentation. Sorry I could not be of any help.

Cheers, Chris Neutrinos

sonydaman commented 4 years ago

Here is ionic desc : The issue raised on Ionic Document

BUG NO : [#37] (https://github.com/NeutrinosPlatform/cordova-plugin-mobile-ocr/issues/37)

CoraNers commented 3 years ago

I'm getting the same error. Tried following the links to the other issue (# 37 raised with Ionic guys) and that was marked as closed due to duplicate. ???

ChrisTomAlx commented 3 years ago

Could you try this instead. Its similar to this plugin and has been updated recently.

Cheers, Chris Neutrinos