How do I handle the scanned results in my application?
To handle scanned results, provide an onDone callback within MRZResultViewConfig. When the user clicks the Done button, your callback receives an MRZResult object, which includes status codes, the parsed data, and an image of the MRZ. Your application can then process the fields as needed, such as logging or submitting data.
For example, to log the first name and status code:
const mrzScanner = new Dynamsoft.MRZScanner({
license: "YOUR_LICENSE_KEY",
resultViewConfig: {
onDone: (result) => {
// result: MRZResult
console.log("First name:", result.data.firstName);
console.log("Status code:", result.status.code);
}
}
});
| Callback | Location | Description |
|---|---|---|
onDone |
resultViewConfig |
Called when user clicks Done; receives MRZResult |
💡 Note: The
MRZResultobject provides the decoded fields, the scan status, and the captured MRZ image. You can implement custom workflows or validation based on these values.