NEWSMRZ Scanner is now part of barKoder.What it means for you →

DOCUMENTATION

API description

MRZ Scanner 1.x (archive) / iOS

Documentation / MRZ Scanner 1.x (archive) / iOS

On this page

 

initUI

 

Inintialize the scanner.

-(void) initUI;

 

 

initUI

 

Inintialize the user interface by specifying the frame of the scanner preview.

@param partialRect the frame of the scanner preview. The CGRect represent percentages relative to the screen size [0 .. 100].

-(void) initUI:(UIViewController*)scannerPresenter partialViewRect:(CGRect) partialRect;

 

 

initUI

 

Inintialize the user interface by specifying the frame of the scanner preview.

@param portraitRect the frame of the scanner preview when the device is in portrait orientation. The CGRect represent percentages relative to the screen size [0 .. 100].
@param landscapeRect the frame of the scanner preview when the device is in landscape orientation. The CGRect represent percentages relative to the screen size [0 .. 100].

-(void) initUI:(UIViewController*)scannerPresenter partialViewRectPortrait:(CGRect) portraitRect partialViewRectLandscape:(CGRect) landscapeRect;

 

 

setNightModeActive

 

Specify the state of night mode. Night mode is used for increasing the ISO and brightness so the scanner performs better in dark environments.


@param active [YES, NO]. Default value is NO.

-(void) setNightModeActive:(BOOL)active;

 

 

setIDActive


Specify whether the scanner should detect and return result for IDs.


@param active [YES, NO]. Default value is YES.

+(void) setIDActive:(BOOL) active;

 

 

setPassportActive

 

Specify whether the scanner should detect and return result for Passports.


@param active [YES, NO]. Default value is YES.

+(void) setPassportActive:(BOOL) active;

 

 

setVisaActive

 

Specify whether the scanner should detect and return result for Visas.


@param active [YES, NO]. Default value is YES.

+(void) setVisaActive:(BOOL) active;

 

 

setMaxCPUCores

 

Specify the maximum number of CPU threads that the scanner can use during the scanning process.


@param maxCPUCores Number of CPU threads. Default value is 2.

-(void) setMaxCPUCores:(int) maxCPUCores;


 

setZoomFactor

 

Set the zoom factor for the camera preview.

@param float. Default value is 1.0

-(void) setZoomFactor:(float) zoomFactor;

 

setScannerType


 Specify which scanner type you want to use. There are two options: "MRZ Scanner" and "Document Image scanner".
 The "MRZ Scanner" option is used to scan for MRZ.
 The "Document image scanner" is used for capturing front and back image of the ID documents.
 
@param scannerType [SCANNER_TYPE_MRZ, SCANNER_TYPE_DOC_IMAGE_ID, SCANNER_TYPE_DOC_IMAGE_PASSPORT ]. Default value is SCANNER_TYPE_MRZ

-(void) setScannerType:(MRZScannerType) scannerType;

 

 

setDateFormat

 

 Set the date format in which the parsed dates are formatted.


@param dateFormat The pattern describing the date format. Example: "dd.MM.YYYY"

+(void) setDateFormat:(NSString *) dateFormat;

 

 

resumeScanner

 

Resume scanning after the scanner has been paused/stopped. Usually after a successful scan.

-(void) resumeScanner;

 

 

closeScanner

 

 Stop and close the MRZ Scanner

-(void) closeScanner;

 

 

registerLicenseWithKey

 

Register with the licence key provided to remove the asterisks (*) from the result.
 
@param key The provided licence key.
@return Returns 0 for success, -1 if registration failed

+(int) registerLicenseWithKey:(NSString*)key;

To get your evaluation key today, register an account on https://mrzscanner.com/register

 

 

getSDKVersion

 

 @return The current MRZScannerSDK Version.

+(NSString*) getSDKVersion;

 

 

scanImage

 

Scan a single image

@param image The UIImage to be scanned.
@return The result data model.

+(MRZResultDataModel *) scanImage:(UIImage*) image;

 

 

scanFromGallery


Scan from gallery


@param context The instance of the initializer controller.
@param mrzDelegate MRZScannerDelegate

+(void) scanFromGallery:(id)context delegate:(id<MRZScannerDelegate>)mrzDelegate;

 

 

setScanningRectangleWithX

 

Set the scanning rectangle to limit the scanning area. The *parameters' values are representing percentages of the scanning preview.

@param x the top-left point of the scanning rectangle. [0,...,100] *Default value: 1.
@param y the top-left point of the scanning rectangle. [0,...,100] *Default value: 30.
@param width the width of the scanning rectangle. [0,...,100] Default *value: 98.
@param height the height of the scanning rectangle. [0,...,100] *Default value: 40.

+(void) setScanningRectangleWithX:(float)x
                           y:(float)y
                           width:(float)width
                           height:(float)height;

 

 

setValidIssuingCountries

 

Set valid issuing country codes. Successful scans with country codes *not included in the array will be ignored.

@param validIssuingCountries array with active country codes. Example *value: @[@"D", @"USA"].

+(void) setValidIssuingCountries:(NSArray<NSString*>*) validIssuingCountries;

 

 

setValidateCountryCodesEnabled

 

Specify whether validation of country codes is enabled.

@param enabled indicates whether validating is enabled. Default: YES.

+(void) setValidateCountryCodesEnabled:(BOOL) enabled;

 

 

ignoreResultIfDocumentIsExpired

 

Successful scans with documents that are expired will be ignored and *the scanning process will continue until a valid document is found.

@param ignore whether the result should be ignored. Default value: *false.

+(void) ignoreResultIfDocumentIsExpired:(BOOL) ignore;

 

 

setCustomOverlayImage

 

Set a custom overlay image for the scanner.

@param customImage the image to be shown on top of the scanner preview.

-(void) setCustomOverlayImage:(UIImage *) customImage;

 

 

enableMinimizedView

 

Enable minimizing of the scanner preview


@param enableMinimized indicates whether the minimizing is enabled. *Default value: false.

-(void) enableMinimizedView:(BOOL) enableMinimized;

 

 

enableScanFromGallery

 

Enable scan from the gallery. If enabled, a "scan from gallery" button *will appear in the scanner preview.

@param enabled indicates whether the "scan from the gallery"  is enabled. *Default value: false.

-(void) enableScanFromGallery:(BOOL) enabled;


 

 

enableUpsideDownScanning


Enable upside-down scanning. If enabled, the scanner will also try the *upside-down format of the preview.

@param enabled indicates whether the "upside-down" feature is enabled. *Default value: NO.

(void) enableUpsideDownScanning:(BOOL) enabled;

 

 

toggleFlash

 

Turn flash on or off.

@param on true = on, false = off. Default value: false.

-(void) toggleFlash:(BOOL) on;

 

 

enableVibrationOnSuccess


Enable vibration on a successful scan.


@param enabled indicates whether the vibration feature is enabled. *Default value: YES.

+(void) enableVibrationOnSuccess:(BOOL) enabled;

 

 

setContinuousScanningEnabled

 

If enabled, after a successful scan, the scanner view will not be paused.
See setIgnoreDuplicates for further continuous scanning behavior changes.

@param enabled indicates whether the scanner should stay active after a *successful scan. Default value: NO.

- (void) setContinuousScanningEnabled:(BOOL) enabled;

 

 

setIgnoreDuplicates

 

Ignore duplicates when scanning continuously.

@param ignore indicates whether the scanner should repeat the last *successful scan. Default value: YES.

- (void) setIgnoreDuplicates:(BOOL) ignore;

 

Updated Jun 18, 2024 · Questions? Ask us