How do i pass 4 arguments ?
ChaminThilakarathne opened this issue · 6 comments
ChaminThilakarathne commented
ChrisTomAlx commented
ChaminThilakarathne commented
cordova-plugin-mobile-ocr 3.1.1 "Textocr"
ChaminThilakarathne commented
this is the documentation which i followed https://ionicframework.com/docs/native/ocr#usage
ChrisTomAlx commented
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.
ChaminThilakarathne commented
It was worked. Thanks a lot.
ChrisTomAlx commented