Closed ChaminThilakarathne closed 5 years ago
cordova-plugin-mobile-ocr 3.1.1 "Textocr"
this is the documentation which i followed https://ionicframework.com/docs/native/ocr#usage
I did not create that documentation or the interface ionic uses.
But as far as I can tell, you don't need to pass in success and failure.
OCR.recText
is a promise function, so you can just look for the resolve and reject, instead of passing in success and error callback functions.
So I guess the function call might look something like (got this from ionic docs) :-
this.ocr.recText(OCRSourceType.NORMFILEURL, "file://path/to/image.png")
.then((res: OCRResult) => console.log(JSON.stringify(res)))
.catch((error: any) => console.error(error));
The link you provided also backs up my claim. There is an example there. Try using the same example.
It was worked. Thanks a lot.