string ExtractMrzResultData(MRZRecognitionResult result) { return(new System.Text.StringBuilder() .Append("documentCode: ").Append(result.DocumentCodeField().Value).Append("\n") .Append("First name: ").Append(result.FirstNameField().Value).Append("\n") .Append("Last name: ").Append(result.LastNameField().Value).Append("\n") .Append("issuingStateOrOrganization: ").Append(result.IssuingStateOrOrganizationField().Value).Append("\n") .Append("departmentOfIssuance: ").Append(result.DepartmentOfIssuanceField().Value).Append("\n") .Append("nationality: ").Append(result.NationalityField().Value).Append("\n") .Append("dateOfBirth: ").Append(result.DateOfBirthField().Value).Append("\n") .Append("gender: ").Append(result.GenderField().Value).Append("\n") .Append("dateOfExpiry: ").Append(result.DateOfExpiryField().Value).Append("\n") .Append("personalNumber: ").Append(result.PersonalNumberField().Value).Append("\n") .Append("optional1: ").Append(result.Optional1Field().Value).Append("\n") .Append("optional2: ").Append(result.Optional2Field().Value).Append("\n") .Append("discreetIssuingStateOrOrganization: ").Append(result.DiscreetIssuingStateOrOrganizationField().Value).Append("\n") .Append("validCheckDigitsCount: ").Append(result.ValidCheckDigitsCount).Append("\n") .Append("checkDigitsCount: ").Append(result.CheckDigitsCount).Append("\n") .Append("travelDocType: ").Append(result.TravelDocTypeField().Value).Append("\n") .ToString()); }
private string ParseData(MRZRecognitionResult result) { var builder = new StringBuilder(); builder.Append(Texts.mrz_document_type).Append(" ").Append(result.TravelDocType.Name()).Append("\n"); builder.Append(Texts.mrz_document_country).Append(" ").Append(result.NationalityField().Value).Append("\n"); builder.Append(Texts.mrz_last_name).Append(" ").Append(result.LastNameField().Value).Append("\n"); builder.Append(Texts.mrz_first_name).Append(" ").Append(result.FirstNameField().Value).Append("\n"); builder.Append(Texts.mrz_document_code).Append(" ").Append(result.DocumentCodeField().Value).Append("\n"); builder.Append(Texts.mrz_dob).Append(" ").Append(result.DateOfBirthField().Value).Append("\n"); builder.Append(Texts.mrz_gender).Append(" ").Append(result.GenderField().Value).Append("\n"); var validity = "Invalid"; if (result.CheckDigitsCount == result.ValidCheckDigitsCount) { validity = "Valid"; } builder.Append(Texts.mrz_checksums).Append(" ").Append(validity).Append("\n"); return(builder.ToString()); }
private string ParseData(MRZRecognitionResult result) { var builder = new StringBuilder(); Append(builder, Texts.mrz_document_code, result.DocumentCodeField().Value); Append(builder, Texts.mrz_first_name, result.FirstNameField().Value); Append(builder, Texts.mrz_last_name, result.LastNameField().Value); Append(builder, Texts.mrz_issuing_organization, result.IssuingStateOrOrganizationField().Value); Append(builder, Texts.mrz_document_of_issue, result.DepartmentOfIssuanceField().Value); Append(builder, Texts.mrz_nationality, result.NationalityField().Value); Append(builder, Texts.mrz_dob, result.DateOfBirthField().Value); Append(builder, Texts.mrz_gender, result.GenderField().Value); Append(builder, Texts.mrz_date_expiry, result.DateOfExpiryField().Value); Append(builder, Texts.mrz_personal_number, result.PersonalNumberField().Value); Append(builder, Texts.mrz_optional1, result.Optional1Field().Value); Append(builder, Texts.mrz_optional2, result.Optional2Field().Value); Append(builder, Texts.mrz_discreet_issuing_organization, result.DiscreetIssuingStateOrOrganizationField().Value); Append(builder, Texts.mrz_valid_check_digits_count, result.ValidCheckDigitsCount.ToString()); Append(builder, Texts.mrz_check_digits_count, result.CheckDigitsCount.ToString()); Append(builder, Texts.travel_doc_type, result.TravelDocTypeField().Value); return(builder.ToString()); }