PLATFORMS << CROSS-PLATFORM APPS
MRZ Scanner for Capacitor
A Capacitor 8 plugin for Android and iOS (SPM and CocoaPods).
- Package@mrzscanner/capacitor
- RequiresCapacitor 8, Android 7+, iOS 15+
- Version2.5.0
Passport & ID
P<UTOERIKSSON<<ANNA<MARIA<<<<<
L898902C36UTO7408122F12041
L898902C36UTO7408122F12041
ERIKSSON, ANNA MARIAL898902C3 · UTO · check digits valid
- 1InstallAdd @mrzscanner/capacitor 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
npm install @mrzscanner/capacitor
npx cap syncScan a document
Capacitortypescript
import { MRZScanner } from '@mrzscanner/capacitor';
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 }