如何解决离子文档扫描仪:结果不正确或用户取消了操作
我遇到了打包 cordova-plugin-document-scanner (https://ionicframework.com/docs/native/document-scanner) 的离子文档扫描仪 (https://github.com/NeutrinosPlatform/cordova-plugin-document-scanner) 的问题。
我正在运行这段代码(从文档中复制)
ngAfterViewInit() {
this.platform.ready().then((readySource) => {
console.log('Platform ready from',readySource);
// Platform now ready,execute any required native code
let opts: DocumentScannerOptions = {};
this.documentScanner.scanDoc(opts)
.then((res: string) => console.log(res))
.catch((error: any) => console.error(error));
});
}
显示相机视图,我拍照,显示图片供用户验证。如果我接受了图片,就会得到这个错误:
Incorrect result or user canceled the action.
我不明白为什么会抛出这个错误。版本:
离子 CLI:6.12.3
离子框架:@ionic/angular 5.6.1
Cordova CLI:10.0.0
Cordova 平台:android 9.0.0
cordova-plugin-document-scanner 4.2.6“扫描”
@ionic-native/document-scanner@5.31.1
在 android 11 设备 (OxygenOS 11.1.1) 上运行
感谢您的帮助。
解决方法
此问题已在最新的 Beta 版中修复。请检查 https://github.com/NeutrinosPlatform/cordova-plugin-document-scanner/issues/74#issuecomment-777267803
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。