PLATFORMS << DESKTOP AND SERVER
MRZ Scanner for Windows
One DLL with a C API, for desktop apps, kiosks and services.
- Packagemrzscanner-windows-x64 (zip)
- RequiresWindows 10 and later, x64
- Version2.5.0
Windowsc
#include "mrzscanner.h"
mrz_register_license("MRZ2...", "com.example.app", "", 4); /* 4: desktop */
mrz_status status;
mrz_scanner *scanner = mrz_scanner_create("C:\\MyApp\\tessdata\\", &status);
mrz_image image = {pixels, width, height, 0, MRZ_PIXEL_BGRA8};
mrz_result *result = NULL;
if (mrz_scan_image(scanner, &image, NULL, &result) == MRZ_OK) {
puts(mrz_result_text(result)); /* the MRZ lines */
puts(mrz_result_json(result)); /* the parsed fields */
}How it starts
- 1Unzip the package from Downloads; ship bin\mrzscanner.dll next to your .exe, with the tessdata folder.
- 2Link lib\mrzscanner.lib (Visual Studio) or lib\libmrzscanner.dll.a (MinGW, clang).
- 3Call mrz_register_license once, create a scanner with the tessdata folder, and pass images to mrz_scan_image.
Install
The zip with mrzscanner.dll, import libraries for Visual Studio and MinGW, the header and an example is under Downloads in the portal. It needs only Windows' own DLLs.
Scan a document
Windowsc
#include "mrzscanner.h"
mrz_register_license("MRZ2...", "com.example.app", "", 4); /* 4: desktop */
mrz_status status;
mrz_scanner *scanner = mrz_scanner_create("C:\\MyApp\\tessdata\\", &status);
mrz_image image = {pixels, width, height, 0, MRZ_PIXEL_BGRA8};
mrz_result *result = NULL;
if (mrz_scan_image(scanner, &image, NULL, &result) == MRZ_OK) {
puts(mrz_result_text(result)); /* the MRZ lines */
puts(mrz_result_json(result)); /* the parsed fields */
}
mrz_result_free(result);
mrz_scanner_destroy(scanner);