PLATFORMS << CROSS-PLATFORM APPS
MRZ Scanner for Cordova
A Cordova plugin for Android and iOS, also for Ionic.
- Package@mrzscanner/cordova
- Requirescordova-android 13+, cordova-ios 7+
- Version2.5.0
Passport & ID
P<UTOERIKSSON<<ANNA<MARIA<<<<<
L898902C36UTO7408122F12041
L898902C36UTO7408122F12041
ERIKSSON, ANNA MARIAL898902C3 · UTO · check digits valid
- 1InstallAdd @mrzscanner/cordova to your project.
- 2Register your keyA 90-day trial key comes with your account; register it once at start.
- 3ScanOpen the camera or scan a photo; read the MRZ text and the parsed fields.
Install
Installbash
cordova plugin add @mrzscanner/cordovaScan a document
Cordovajavascript
// after deviceready, the plugin is window.MRZScanner
await MRZScanner.registerLicense('MRZ2...'); // once; without it some fields are masked
const result = await MRZScanner.scan({ documentTypes: ['passport', 'id'] });
if (result.status === 'read') {
const read = result.reads[0];
console.log(read.text, read.fields.document_number, read.checkDigitsValid);
}
const fromPhoto = await MRZScanner.scanImage({ base64: jpegBase64 }); // or { path }