PhoneGap条形码扫描仪未扫描PDF417条形码



我正在尝试扫描PDF417条形码,使用此https://github.com/phothgap-build/barcodescanner repository.my的主要目的是扫描美国驾驶执照并获取全部细节它,但是它总是显示出错误的结果和不同的格式UPC_E,即使我扫描PDF417格式barcode.i我也添加了格式过滤器,但它不起作用。

cordova.plugins.barcodeScanner.scan(
      function (result) {
          alert("We got a barcoden" +
                "Result: " + result.text + "n" +
                "Format: " + result.format + "n" +
                "Cancelled: " + result.cancelled);
      }, 
      function (error) {
          alert("Scanning failed: " + error);
      }
   );

默认情况下,除非将其添加到插件设置中,否则条形码扫描仪不会扫描PDF417。

您已经链接到https://github.com/phonegap-build/barcodescanner,该插件是一个4岁的叉子,它是一个不长的bant插件,并且缺少完整的文档。我个人认为,它与Windows 98一样过时。

正如您在新的 phonegap-plugin-barcodescanner 上看到的那样,如果您想读取这些代码,则必须在formats列表中添加 PDF417

{
    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
}

我强烈建议只使用官方,最新的插件,如果可能的话,如果某些内容不按预期工作,请在 evesise 部分中报告。移至较旧的叉子。

Android 6.0更改了权限系统,此之前的大多数插件已经过时了。

最新更新