I developed barcodescanner application in phonegap android.I am able to scan qrcode and barcode. But I am unable to scan this 2d barcode. Is it my fault or the code fault?
function scanCode(){
var scanner = cordova.require("cordova/plugin/BarcodeScanner");
scanner.scan(
function(result){
alert("Scanned Code: " + result.text
+ ". Format: " + result.format
+ ". Cancelled: " + result.cancelled);
},
function(error){
alert("Scan failed: " + error);
}
);
}
function encodeData(){
var data = document.getElementById("data").value;
if (data != ''){
cordova.plugins.barcodeScanner.encode(
BarcodeScanner.Encode.TEXT_TYPE, data,
function(success){
alert("Encode success: " + success);
},
function(fail){
alert("Encoding failed: " + fail);
}
);
}
else{
alert("Please enter some data.");
return false;
}
}
That is a PDF417 barcode. It looks like the BarcodeScanner plugin has problems with that format. Try another plugin, like this one: