Multiscan SDK for iOS (MRZ + PDF417)
Passport MRZ Scanner SDK for iOS
Download: Multiscan Scanner SDK + example
To obtain a license key, please email your application’s Bundle ID to support@idscan.net
Setup
Objective-C
Add BarcodeScanner.framework to your project
Delete duplicate from “Linked Frameworks and Libraries” section
Add mrz_190307_022802.tflite in project Build Phases->Copy Bundle Resources
Add ScannerViewController
Developers should send an email to support@idscan.net with their app’s Bundle ID in order to receive your “cameraKey”. Make sure you provide your order number if you ready to upgrade from trial to production.
To register the library use for scan MRZ
[scanner registerMRZKey:@"MRZKey"];
To register the library use for scan PDF417
[scanner registerCode:@"cameraKey"];
Using
To get the pdf417 result from the image utilize
NSString* result = [scanner scanGrayscaleImage: frameBuffer Width: width Height: height];
To get the MRZ result from the image utilize
NSString *result = [self.scanner detectMRZ:frameBuffer width:(int)self->width height:(int)self->height];
If you plan to customize the camera interface , in the method
(void) CustomeOverlay
for all elements apply[self.view bringSubviewToFront:elementName];
Swift
In you Swift project you should follow the same way, as in the Objective-C:
Add BarcodeScanner.framework and our camera class (ScannerViewController) to you project
Make you own class and Inheritance it from ScannerViewController, add a “Close” button to your Camera view controller (don’t forget to move the button to the front)
class SwiftViewController: ScannerViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) let rect : CGRect = CGRect(x: 20, y: 20, width: 100, height: 30) let close: UIButton = UIButton(frame: rect) close.setTitle("Close", for: .normal) close.backgroundColor = UIColor.darkGray close.addTarget(self, action: #selector(closeBtn), for: .touchUpInside) self.view.addSubview(close) self.view.bringSubview(toFront: close) } }
If you want to make you own Camera Class from scratch you should do this:
- Import BarcodeScanner.framework to you project
import BarcodeScanner
- Make instance of scanner
var scanner = Barcode2DScanner()
- Register camera with you MRZ key
scanner.registerMRZKey("MRZKey")
- Register pdf camera with you PDF417 key
scanner.registerCode(forKey: "cameraKey")
Using
For MRZ call detectMRZ(UnsafeMutablePointer!, width: Int32, height: Int32) method from instance:
var result = scanner.detectMRZ(UnsafeMutablePointer!, width: Int32, height: Int32)
For PDF417 call scanGrayscaleImage(pp_image: width: height: ) method from instance:
var result = scanner.scanGrayscaleImage(UnsafeMutablePointer!, width: Int32, height: Int32)
Swift implementation of our framework you can download HERE.
Note
If you have "Could not find or use auto-linked library" while archiving your app it's xcode issue. You can find more about the problem and workaround by this link.