Parse and extract information from MRZ string. Used by SmartScanner Core to extract data from the scanned MRZ.
Declare Maven Central repository in the dependency configuration, then add this library in the dependencies. An example using build.gradle
:
repositories {
mavenCentral()
}
dependencies {
implementation "org.idpass:smartscanner-mrz-scanner:0.0.1-SNAPSHOT"
}
If you want to build this library from source, instructions to do so can be found in the Building from source wiki page.
Import the MrzParser
class from the library. This provides methods for working with MRZ strings.
import org.idpass.smartscanner.mrz.parser.innovatrics.MrzParser;
Call MrzParser.parse()
to parse an MRZ string. Refer to the API Reference for other available methods in the MrzParser
class and the properties of the parsed record.
String mrz = "I<UTOD231458907<<<<<<<<<<<<<<<\n" +
"7408122F1204159UTO<<<<<<<<<<<6\n" +
"ERIKSSON<<ANNA<MARIA<<<<<<<<<<";
MrzRecord parsed = MrzParser.parse(mrz);