C#
VB
Java
Objective-C
C++
Data Element Line Index.
public int LineIndex { get; }
Returns the line index that contains this MRTDDataElement.
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Forms;
using Leadtools.Forms.Ocr;
using Leadtools.Forms.Commands;
public void TestMRTDReader()
{
// Initialize the RasterCodecs class
RasterCodecs codecs = new RasterCodecs();
// Initialize the BankCheckReader class
MRTDReader mrtdReader = new MRTDReader();
// The bank cheque image
string chequePath = Path.Combine(LEAD_VARS.ImagesDir, "MRZ_SAMPLE.jpg");
RasterImage image = codecs.Load(chequePath);
IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false);
ocrEngine.Startup(codecs, null, null, LEAD_VARS.OcrAdvantageRuntimeDir);
// Assign Engine to Reader
mrtdReader.OcrEngine = ocrEngine;
// Process Image
mrtdReader.ProcessImage(image);
if (mrtdReader.Errors == MRTDErrors.NoError)
{
foreach (var value in mrtdReader.Results)
{
Console.WriteLine(string.Format("Data Element Field: {0}", value.Key.ToString()));
Console.WriteLine(string.Format("Data Element Value: {0}", value.Value.ReadableValue));
Console.WriteLine(string.Format("Data Element Code : {0}", value.Value.MrzCharacters));
Console.WriteLine(string.Format("Data Element Valid: {0}", value.Value.IsValid.ToString()));
Console.WriteLine("************************************");
}
}
ocrEngine.Shutdown();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\Users\Public\Documents\LEADTOOLS Images";
public const string OcrAdvantageRuntimeDir = @"C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime";
}