How to scan a 2D barcode using ZBar library in iOS. Do I need to set a symbol type (like ZBAR_QRCODE) to scan the 2D barcodes? I had checked other questions related to scanning, but nothing gives a correct answer to 2D barcodes. Please anyone help me on this. Attached a 2D barcode image for reference.
Barcode you're trying to scan is PDF417. It looks like Zbar doesn't support it:
ZBar is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code.
I suggest you use some other library for scanning PDF417.
If you target iOS 7.0+, your simplest option is to use MTBBarcodeScanner, which is a neat wrapper around a built in AVFoundation framework.
If you target iOS 6.0 as well, or need a more robust solution (like for scanning US driver's licenses, or a solution which will work on Androids as well), try PDF417.mobi SDK.
You can easily try PDF417.mobi SDK if you use CocoaPods by running
pod try PPpdf417