Documentation / MRZ Scanner 1.x (archive) / Ionic
On this page
- startScanner
- closeScanner
- setMaxThreads
- setZoomFactor
- setScannerType
- resumeScanner
- setDateForma
- (Promise)getSdkVersion
- setIDActive
- setPassportActive
- setVisaActive
- registerWithLicenseKey
- (Promise)scanFromGallery
- setContinuousScanningEnabled
- setIgnoreDuplicatesEnabled
- setVibrateOnSuccessfulScan
- startPartialViewScanner
-To interact with the module, you need to add a global variable declare var MrzScanner; (its needs to specifically be named "MrzScanner") :
declare var MrzScanner: any;
startScanner
Activates the scanner, with a default SCANNER_TYPE_MRZ if not specified.
@return: ‘successfulMrzScan’: returns results of your scan as JSON Object
@return: ‘scanFailed’ : returns error String
MrzScanner.startScanner(success, error);
closeScanner
Stop and close the MRZ Scanner
MrzScanner.closeScanner();
setMaxThreads
Specify the maximum number of CPU threads that the scanner can use
during the scanning process.
@param Int: maxThreads, number of CPU threads. The default value is 2.
MrzScanner.setMaxThreads(maxThreads);
setZoomFactor
Set the zoom factor for the camera preview.
@param number. Default value is 1.0
MrzScanner.setZoomFactor(zoomFactor: number)
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 the front and back image of the ID documents.
@param Int : scannerTyle [1: SCANNER_TYPE_MRZ, 2: SCANNER_TYPE_DOC_IMAGE_ID, 3 : SCANNER_TYPE_DOC_IMAGE_PASSPORT]. Default value is SCANNER_TYPE_MRZ
MrzScanner.setScannerType(scannerTyle);
Example: MrzScanner.setScannerType(1);
resumeScanner
Resume scanning after the scanner has been paused/stopped. Usually after a successful scan.
MrzScanner.resumerScanner();
setDateForma
Set the date format in which the parsed dates are formatted.
@param dateFormat the pattern describing the date format.
Example: "dd.MM.yyyy"
MrzScanner.setDateFormat("dd.MM.yyyy");
(Promise)getSdkVersion
@return : versionStringSuccess - returns the current SDK Version.
MrzScanner.getSdkVersion(success, error);
setIDActive
Specify whether the scanner should detect and return results for IDs.
@param activate [true, false]. The default value is true.
MrzScanner.setIDActive(activate);
setPassportActive
Specify whether the scanner should detect and return results for passports.
@param activate [true, false]. The default value is true
MrzScanner.setPassportActive(activate);
setVisaActive
Specify whether the scanner should detect and return results for *visas.
@param activate [true, false]. Default value is true.
MrzScanner.setVisaActive(activate);
registerWithLicenseKey
Register with the license key provided to remove the asterisks (*) from the result.
@param key the provided license key.
@return : resultKey = 0 for success, -1 if registration failed.
MrzScanner.registerWIthLicenseKey(arg0, success, error);
To get your evaluation key today, register an account on https://mrzscanner.com/register
(Promise)scanFromGallery
Trigger an image picker.
@return: ‘successfulMrzScan’: returns results of your scan as JSON Object
MrzScanner.scanFromGalley(success);
setContinuousScanningEnabled
Initiates the scanner view with continuous scanning enabled.
After a successful scan, the scanner will not be dismissed or paused.
To close the scanner call closeScanner().
See setIgnoreDuplicatesEnabled for further continuous scanning behavior changes.
@param boolean: activate.
MrzScanner.setContinuousScanningEnabled(activate);
setIgnoreDuplicatesEnabled
Ignores duplicate is used to specify whether the scanner should ignore *the successful scan if the document number is identical to the previous *successful scan.
@param boolean: activate.
MrzScanner.setIgnoreDuplicatesEnabled(activate);
setVibrateOnSuccessfulScan
Enables vibrate on a successful scan option.
@param boolean: activate.
MrzScanner.setVibrateOnSuccessfulScan(activate);
startPartialViewScanner
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: 5.
@param y the top-left point of the scanning rectangle. [0,...,100]Default value: 20.
@param width the width of the scanning rectangle. [0,...,100]Default value: 90.
@param height the height of the scanning rectangle. [0,...,100]Default value: 60.
MrzScanner.startPartialViewScanner(x,y,width,height);
*Sample apps and more detailed instructions are included with the download file.
Download link: https://mrzscanner.com/download.
Updated Jun 18, 2024 · Questions? Ask us