4 ms·
> 2D barcode Which JS library do you use? I couldn't find a single library that can reliably scan PDF417 barcodes.
by thekingshorses 3y ago
> 2D barcode
Which JS library do you use?
I couldn't find a single library that can reliably scan PDF417 barcodes.
- martinald 3y agoI assume the built in one that OP has? https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Detection_API https://developer.mozilla.org/en-US/docs/Web/API/Barcode_Det...
- sevenf0ur 3y agoSafari doesn't support that API whatsoever so a third party JS library is really your only option. The landscape of open source barcode detection libraries is bleak at the moment.
- martinald 3y agoThat's a shame. Works really well on Android.
- asveikau 3y agoCan't you take a C library and compile to JS?
- cicko 3y agoWasm should also work, no?
- dannymoerkerke 3y agoIt does since iOS 17. For now you’ll have to enable it manually through Settings > Safari > Advanced > Feature Flags > Shape Detection API but I expect it to be enabled by default soon.
- JimDabell 3y agoThis is another Google-authored specification, implemented only by Google, which is not currently a web standard. It’s not just Safari that doesn’t support it; Firefox doesn’t either. It’s a Blink-only API. > Editors: > Miguel Casas-Sanchez (Google LLC) > Reilly Grant (Google LLC) > Status of this document > This specification was published by the Web Platform Incubator Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. — https://wicg.github.io/shape-detection-api/ https://wicg.github.io/shape-detection-api/
- bob1029 3y agohttps://github.com/zxing-js/library https://github.com/zxing-js/library Media constraints are the #1 reason it won't scan in my experience. You need at least ~1000px horizontal to reliably decode PDF417. If the resolution is 720p or lower, you aren't capturing enough information for a decode.
- k__ 3y agoI tried zxing too. Scanning 2D barcodes only works reliable on smartphones with good camera and with good lighting. I needed it for a ticket scanner used on an old phone at night entries for concerts. Went and bought a hardware scanner (for 30€ or something) that connects itself as a "Bluetooth keyboard". Works like a charm.
- bob1029 3y ago> Scanning 2D barcodes only works reliable on smartphones We wont even fully certify iPhones for use with this solution because we have seen consistent failure to autofocus on the barcode for "some weird reason". iPads work like magic though. I have to go out of my way to not get a quick scan on recent generation iPad camera. We went down the hardware scanning path w/ keyboard emulation in the browser, but its kind of clunky when you are considering the overall solution stack in a B2B setting.
- dvsk 3y agoIf you’re open to using a commercial solution then there is a WebSDK offered by Scandit - https://www.scandit.com/products/web-sdk/ https://www.scandit.com/products/web-sdk/ - full disclosure, I manage their website, however I thought this maybe of interest.
- jwr 3y agoScandit customer here. Their stuff works well. The only drawbacks are reliance on npm and frequently changing APIs.
- jr19mi 3y agoFull disclosure: I work for Scanbot SDK, but we do offer PDF417 scanning for JS. It's a commercial solution that comes with a not-insignificant price tag, but it might be what you're looking for. You can check out the demo and documentation here: https://scanbot.io/trial/demo-web/barcode-demo/ https://scanbot.io/trial/demo-web/barcode-demo/ , https://docs.scanbot.io/barcode-scanner-sdk/web/introduction/ https://docs.scanbot.io/barcode-scanner-sdk/web/introduction...