默认情况下,条形码扫描仪插件不会扫描 PDF417,除非您将其添加到插件设置中。
您已链接到https://github.com/phonegap-build/BarcodeScanner,这是一个 4 年前的分支,来自一个不再受维护的插件,它缺乏完整的文档。在我个人看来,它和 Windows 98 一样过时了。
正如您在较新的phonegap-plugin-barcodescanner中看到的那样,如果您想阅读这些代码,则必须将PDF417添加到列表中。formats
{
preferFrontCamera : true, // iOS and Android
showFlipCameraButton : true, // iOS and Android
showTorchButton : true, // iOS and Android
torchOn: true, // Android, launch with the torch switched on (if available)
saveHistory: true, // Android, save scan history (default false)
prompt : "Place a barcode inside the scan area", // Android
resultDisplayDuration: 500, // Android, display scanned text for X ms. 0 suppresses it entirely, default 1500
/* Add here PDF_417 to support it */
formats : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device
disableAnimations : true, // iOS
disableSuccessBeep: false // iOS and Android
disableSuccessBeep: false // iOS and Android
}
我强烈建议尽可能只使用官方的、最新的插件,如果某些东西没有按预期工作,请在问题部分报告它,而不是转移到较旧的分支。
Android 6.0 改变了权限系统,之前的大部分插件现在都已经过时了。