Open omerbhutta opened 2 years ago
OS and browser version, error message if any
It only shows that QR code format is not supported.
Same issue here too.. unable to scan PDF_417 in chrome Version 103.0.5060.114 (Official Build) (64-bit)
My code...
import React from 'react';
import { Html5Qrcode, Html5QrcodeSupportedFormats } from 'html5-qrcode';
export class BarCodeScanner extends React.Component {
componentDidMount() {
Html5Qrcode.getCameras().then((devices) => {
console.log("Found devices:", devices );
if ( devices.length > 0 ) {
this.cameraId = devices[0].id;
this.scanner = new Html5Qrcode('scanner',{
verbose: true,
formatsToSupport: [ Html5QrcodeSupportedFormats.PDF_417 ],
experimentalFeatures: { useBarCodeDetectorIfSupported: false }
});
this.scanner.start( this.cameraId, { fps: 10 },
(decodedText, decodedResult) => {
console.log('decodedText:', decodedText );
console.log('decodedResult:', decodedResult );
},
(err) => {
console.error("decode error:", err );
}
).catch((err) => {
console.error("Failed to start decoder:", err );
})
} else {
console.error("Failed to find any camera devices!");
}
})
}
componentWillUnmount() {
if ( this.scanner ) {
this.scanner.stop();
}
}
render() {
return <div id='scanner' style={{width: '100%'}}>
</div>
}
}
export default BarCodeScanner;
change to experimentalFeatures: { useBarCodeDetectorIfSupported: true}
I had already tried it both true and false, no difference. Matter of fact, when I posted my code sample originally it was true, then I thought you guys would tell me to set it to false, so tried that as well, no difference.
useBarCodeDetectorIfSupported to true means the standard javascript API engine is taking the relay. if this is not working, so it surely comes from the barcode you are scanning. is the same barcode you are using for test works with other online scanner?
Yes, just testing with my own DL. The BlinkID PDF_417 scanner worked, but their pricing for a license was through the roof. I noticed this project uses the ZXing library, which I've also tested and it didn't work either. In fact, their own online demo doesn't even manage to scan their test images for PDF_417 either. (see https://zxing-js.github.io/library/examples/pdf417-image/)
So this might be a bug in the underlying ZXing library.
I have the same issue with PDF_417. I am not able to scan with Chrome Version 109.0.5414.75
and Edge Version 109.0.1518.52
on Windows 11
I have noticed that for PDF417 orientation matters. It seems to detect them only in certain orientation (horizontal)
same issue here testing with Chrome Version 110.0.5481.177 (Official Build) (x86_64) on MacOS.
I have the same issue with Chrome Version 120.0.6099.129 (Official Build) (arm64) on MacOS.
I am trying to integrate HTML bar code version and you mention in the documentation that the script has functionality to scan PDF417 but it didn't.
===================== Code that i am using
function docReady(fn) { if (document.readyState === "complete" || document.readyState === "interactive") { setTimeout(fn, 1); } else { document.addEventListener("DOMContentLoaded", fn); } }
====================