How to enable MRZ Mode
MRZ Scanning extracts critical data from the machine-readable zone of documents, particularly travel-related IDs such as passports and visas. This data includes personal information like name, nationality, passport number, and expiration date. MRZ scanning is essential in applications like border control, immigration, and identity verification.
private setBarcodeTypeEnabled(): void {
this.barkoderView.setBarcodeTypeEnabled([
BarkoderConstants.DecoderType.IDDocument
]);
}
ou can also obtain the images from the MRZ sample using the following code:
scanningFinished(results: any[], thumbnails: any[], resultImage: any): void {
if (results && results.length > 0) {
for (let i = 0; i < results.length; i++) {
// Check if the barcode type is "MRZ"
if (results[i].barcodeTypeName === "MRZ") {
// Check if there are any images
if (results[i].images && results[i].images.length > 0) {
for (let j = 0; j < results[i].images.length; j++) {
const imageDescriptor = results[i].images[j];
const imageName = imageDescriptor.name;
const imageBitmap = imageDescriptor.image;
// Check the name of the image and assign accordingly
switch (imageName) {
case "main":
this.mainBitmap = imageBitmap;
break;
case "document":
this.documentBitmap = imageBitmap;
break;
case "signature":
this.signatureBitmap = imageBitmap;
break;
case "picture":
this.pictureBitmap = imageBitmap;
break;
}
}
}
}
}
}
}