←Select platform

MRTDField Enumeration

Summary
Represents MRTD Field.
Syntax
C#
Objective-C
C++/CLI
Java
Python
public enum MRTDField  
typedef NS_ENUM(NSInteger, LTMRTDField) { 
 LTMRTDFieldType = 0,  
 
 LTMRTDFieldDocumentCode,  
 LTMRTDFieldDocumentNumber,  
 LTMRTDFieldPassportNumber,  
 
 LTMRTDFieldIssuingState,  
 LTMRTDFieldName,  
 LTMRTDFieldLastName,  
 LTMRTDFieldSex,  
 
 LTMRTDFieldNationality,  
 LTMRTDFieldDateOfBirth,  
 LTMRTDFieldDateOfExpiry,  
 LTMRTDFieldValidUntilDate,  
 
 LTMRTDFieldOptionalData,  
 LTMRTDFieldOptionalData2,  
 LTMRTDFieldIDCardNumber,  
 
 LTMRTDFieldPassportNumberCheckDigit = 100,  
 LTMRTDFieldDocumentNumberCheckDigit,  
 LTMRTDFieldIDCardNumberCheckDigit,  
 LTMRTDFieldDateOfBirthCheckDigit,  
 LTMRTDFieldDateOfExpiryCheckDigit,  
 LTMRTDFieldValidUntilDateCheckDigit,  
 LTMRTDFieldOptionalDataCheckDigit,  
 LTMRTDFieldCompositeCheckDigit,  
 LTMRTDFieldOverallCheckDigit 
}; 
public final class MRTDField 
    extends java.lang.Enum<MRTDField> 
public enum class MRTDField  
class MRTDField(Enum): 
   Type = 0 
   DocumentCode = 1 
   DocumentNumber = 2 
   PassportNumber = 3 
   IssuingState = 4 
   Name = 5 
   LastName = 6 
   Sex = 7 
   Nationality = 8 
   DateOfBirth = 9 
   DateOfExpiry = 10 
   ValidUntilDate = 11 
   OptionalData = 12 
   OptionalData2 = 13 
   IDCardNumber = 14 
   PassportNumberCheckDigit = 100 
   DocumentNumberCheckDigit = 101 
   IDCardNumberCheckDigit = 102 
   DateOfBirthCheckDigit = 103 
   DateOfExpiryCheckDigit = 104 
   ValidUntilDateCheckDigit = 105 
   OptionalDataCheckDigit = 106 
   CompositeCheckDigit = 107 
   OverallCheckDigit = 108 
Members
ValueMemberDescription
0Type The Type of the Document.
1DocumentCode The Code of the Document.
2DocumentNumber The Number of the Document.
3PassportNumber The Number of the Passport.
4IssuingState The Issuing State of the Document.
5Name The Name of the Document Holder.
6LastName The Last name of the Document Holder.
7Sex The Sex of the Document Holder.
8Nationality The Nationality of the Document Holder.
9DateOfBirth The Date Of Birth for the Document Holder.
10DateOfExpiry The Date Of Expiry for the Document.
11ValidUntilDate Valid Until Date for the Document.
12OptionalData The Optional Data for the Document.
13OptionalData2 The Optional Data for the Document(some documents has two optional Data).
14IDCardNumber The number of the Identification Card.
100PassportNumberCheckDigit The Check Digit for Passport number.
101DocumentNumberCheckDigit The Check Digit for the Document number.
102IDCardNumberCheckDigit The Check Digit for the Id Card number.
103DateOfBirthCheckDigit The Check Digit for the Date Of Birth.
104DateOfExpiryCheckDigit The Check Digit for the Date Of Expiry.
105ValidUntilDateCheckDigit The Check Digit for the "Valid Until Date" field.
106OptionalDataCheckDigit The Check Digit for Optional Data.
107CompositeCheckDigit The Composite Check Digit.
108OverallCheckDigit The Overall Check Digit.
Remarks

MRTDField is used in MRTDDataElement to show the data element related field.

Example
C#
Java
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Forms.Common; 
using Leadtools.Ocr; 
using Leadtools.Forms.Commands; 
 
 
public void TestMRTDReader() 
{ 
   // Initialize the RasterCodecs class 
   RasterCodecs codecs = new RasterCodecs(); 
 
   // Initialize the MRTDReader class 
   MRTDReader mrtdReader = new MRTDReader(); 
 
   // The MRTD image 
   string mrtdPath = Path.Combine(LEAD_VARS.ImagesDir, "MRZ_SAMPLE.jpg"); 
   RasterImage image = codecs.Load(mrtdPath); 
 
   IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD); 
   ocrEngine.Startup(codecs, null, null, LEAD_VARS.OcrLEADRuntimeDir); 
 
   // 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:\LEADTOOLS23\Resources\Images"; 
   public const string OcrLEADRuntimeDir = @"C:\LEADTOOLS23\Bin\Common\OcrLEADRuntime"; 
} 
 
import java.io.File; 
import java.io.IOException; 
import java.time.LocalDateTime; 
 
import org.junit.*; 
import org.junit.Test; 
import org.junit.runner.JUnitCore; 
import org.junit.runner.Result; 
import org.junit.runner.notification.Failure; 
import static org.junit.Assert.*; 
 
import leadtools.*; 
import leadtools.barcode.*; 
import leadtools.codecs.*; 
 
 
public void TestMRTDReader() 
{ 
   // Initialize the RasterCodecs class 
   RasterCodecs codecs = new RasterCodecs(); 
 
   // Initialize the MRTDReader class 
   MRTDReader mrtdReader = new MRTDReader(); 
 
   // The MRTD image 
   string mrtdPath = Path.Combine(LEAD_VARS.ImagesDir, "MRZ_SAMPLE.jpg"); 
   RasterImage image = codecs.Load(mrtdPath); 
 
   IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.LEAD); 
   ocrEngine.Startup(codecs, null, null, LEAD_VARS.OcrLEADRuntimeDir); 
 
   // 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(); 
} 
 
public class LEAD_VARS 
{ 
   public final static String ImagesDir = "C:\LEADTOOLS23\Resources\Images"; 
   public final static String OcrLEADRuntimeDir = "C:\LEADTOOLS23\Bin\Common\OcrLEADRuntime"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.14
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Forms.Commands Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.