Getting results
Text Results
If you know exactly what text data are needed, the fastest way to get information is to use special functions.
Getting values
Getting values of text fields indicating fieldType:
// Get full name
var surnameAndGivenNames = results.GetTextFieldValueByType(EVisualFieldType.FtSurnameAndGivenNames);
// Get date of birth
var dateOfBirth = results.GetTextFieldValueByType(EVisualFieldType.FtDateOfBirth);
// Get document number
var documentNumber = results.GetTextFieldValueByType(EVisualFieldType.FtDocumentNumber);
// Get full name
var surnameAndGivenNames = results.GetTextFieldValueByType(RGLFieldType.Surname_And_Given_Names);
// Get date of birth
var dateOfBirth = results.GetTextFieldValueByType(RGLFieldType.Date_of_Birth);
// Get document number
var documentNumber = results.GetTextFieldValueByType(RGLFieldType.Document_Number);
Getting values of text fields indicating fieldType, lcid:
// Get full name
var surnameAndGivenNames = results.GetTextFieldValueByType(EVisualFieldType.FtSurnameAndGivenNames, LCID.Belarusian);
// Get place of birth
var placeOfBirth = results.GetTextFieldValueByType(EVisualFieldType.FtPlaceOfBirth, LCID.GermanGermany);
// Get full name
var surnameAndGivenNames = results.GetTextFieldValueByType(RGLFieldType.Surname_And_Given_Names, Rgllcid.Belarusian);
// Get place of birth
var placeOfBirth = results.GetTextFieldValueByType(RGLFieldType.Place_of_Birth, Rgllcid.GermanGermany);
Getting values of text fields indicating fieldType, lcid, source:
// Get full name
var surnameAndGivenNames = results.GetTextFieldValueByType(EVisualFieldType.FtSurnameAndGivenNames, LCID.Belarusian, ERPRM_ResultType.RprmResultTypeVisualOcrExtended);
// Get address
var address = results.GetTextFieldValueByType(EVisualFieldType.FtAddress, LCID.Latin, ERPRM_ResultType.RprmResultTypeBarCodesTextData);
// Get full name
var surnameAndGivenNames = results.GetTextFieldValueByType(RGLFieldType.Surname_And_Given_Names, Rgllcid.Belarusian, RGLResultType.VisualOCRExtended);
// Get address
var address = results.GetTextFieldValueByType(RGLFieldType.Address, Rgllcid.Latin, RGLResultType.BarCodesTextData);
Getting values of text fields indicating fieldType, lcid, source, original:
// Get surname
var surname = results.GetTextFieldValueByType(EVisualFieldType.FtSurname, LCID.Belarusian, ERPRM_ResultType.RprmResultTypeVisualOcrExtended, true);
// Get address
var address = results.GetTextFieldValueByType(EVisualFieldType.FtAddress, LCID.Latin, ERPRM_ResultType.RprmResultTypeBarCodesTextData, true);
// Get surname
var name = results.GetTextFieldValueByType(RGLFieldType.Surname, Rgllcid.Belarusian, RGLResultType.VisualOCRExtended, true);
// Get address
var address = results.GetTextFieldValueByType(RGLFieldType.Address, Rgllcid.Latin, RGLResultType.BarCodesTextData, true);
Getting values of text fields indicating fieldType, source:
// Get surname
var surname = results.GetTextFieldValueByTypeAndSource(EVisualFieldType.FtSurname, ERPRM_ResultType.RprmResultTypeVisualOcrExtended);
// Get surname
var surname = results.GetTextFieldValueByType(RGLFieldType.Surname, RGLResultType.VisualOCRExtended);
Getting values of text fields indicating fieldType, source, original:
// Get surname
var surname = results.GetTextFieldValueByTypeAndSource(EVisualFieldType.FtSurname, ERPRM_ResultType.RprmResultTypeVisualOcrExtended, true);
// Get surname
var surname = results.GetTextFieldValueByType(RGLFieldType.Surname, RGLResultType.VisualOCRExtended, true);
Getting values of text fields indicating fieldType, original:
// Get surname
var surname = results.GetTextFieldValueByType(RGLFieldType.Surname, true);
You can also go through all instances of text fields and obtain the desired information, e.g.:
foreach (DocumentReaderTextField textField in results.TextResult.Fields)
{
var value = results.GetTextFieldValueByType(textField.FieldType, textField.Lcid);
Log.Debug("MainActivity", value + "\n");
}
foreach (var textField in results.TextResult.Fields)
{
var value = result.GetTextFieldValueByType(textField.FieldType, textField.Lcid);
Console.WriteLine("Value: {0}", value);
}
Getting statuses
Getting statuses of text fields indicating fieldType (one of ECheckResult
values):
// Get status of FT_SURNAME_AND_GIVEN_NAMES
var surnameAndGivenNames = results.GetTextFieldStatusByType(EVisualFieldType.FtSurnameAndGivenNames);
// Get status of FT_DATE_OF_BIRTH
var dateOfBirth = results.GetTextFieldStatusByType(EVisualFieldType.FtDateOfBirth);
Getting statuses of text fields indicating fieldType, lcid (one of ECheckResult
values):
// Get status of FT_SURNAME_AND_GIVEN_NAMES
var surnameAndGivenNames = results.GetTextFieldStatusByType(EVisualFieldType.FtSurnameAndGivenNames, LCID.Belarusian);
// Get status of FT_DATE_OF_BIRTH
var dateOfBirth = results.GetTextFieldStatusByType(EVisualFieldType.FtDateOfBirth, LCID.Latin);
Getting instances
Getting instances of text fields indicating fieldType:
// Get a surname instance
DocumentReaderTextField textField = results.GetTextFieldByType(EVisualFieldType.FtSurname);
// Get a surname instance
var surname = results.GetTextFieldByType(RGLFieldType.Surname);
Getting instances of graphic fields indicating fieldType, lcid:
// Get a surname instance
DocumentReaderTextField textField = results.GetTextFieldByType(EVisualFieldType.FtSurname, LCID.Russian);
// Get a surname instance
var surname = results.GetTextFieldByType(RGLFieldType.Surname, Rgllcid.Russian);
Graphic Results
Getting values
Getting values of graphic fields indicating fieldType:
// Get document image
var documentImage = results.GetGraphicFieldImageByType(EGraphicFieldType.GfDocumentImage);
// Get portrait image
var portrait = results.GetGraphicFieldImageByType(EGraphicFieldType.GfPortrait);
// Get document image
var documentImage = results.GetGraphicFieldImageByType(RGLGraphicFieldType.DocumentImage);
// Get portrait image
var portrait = results.GetGraphicFieldImageByType(RGLGraphicFieldType.Portrait);
Getting values of graphic fields indicating fieldType, source:
// Get document image
var documentImage = results.GetGraphicFieldImageByType(EGraphicFieldType.GfDocumentImage, ERPRM_ResultType.RprmResultTypeRawImage);
// Get document image (uncropped)
var documentImageUncropped = results.GetGraphicFieldImageByType(EGraphicFieldType.GfDocumentImage, ERPRM_ResultType.RprmResultTypeRawUncroppedImage);
// Get portrait image
var portrait = results.GetGraphicFieldImageByType(EGraphicFieldType.GfPortrait, ERPRM_ResultType.RprmResultTypeGraphics);
// Get document image
var documentImage = results.GetGraphicFieldImageByType(RGLGraphicFieldType.DocumentImage, RGLResultType.RawImage);
// Get document image (uncropped)
var documentImageUncropped = results.GetGraphicFieldImageByType(RGLGraphicFieldType.DocumentImage, RGLResultType.RawUncroppedImage);
// Get portrait image
var portrait = results.GetGraphicFieldImageByType(RGLGraphicFieldType.Portrait, RGLResultType.Graphics);
Getting values of graphic fields indicating fieldType, source, pageIndex:
// Get document image from the second page
var documentImage = results.GetGraphicFieldImageByType(EGraphicFieldType.GfDocumentImage, ERPRM_ResultType.RprmResultTypeRawImage, 1);
// Get portrait image from the first page
var portrait = results.GetGraphicFieldImageByType(EGraphicFieldType.GfPortrait, ERPRM_ResultType.RprmResultTypeGraphics, 0);
// Get document image from the second page
var documentImage = results.GetGraphicFieldImageByType(RGLGraphicFieldType.DocumentImage, RGLResultType.RawImage, 1);
// Get portrait image from the first page
var portrait = results.GetGraphicFieldImageByType(RGLGraphicFieldType.Portrait, RGLResultType.Graphics, 0);
Getting values of graphic fields indicating fieldType, source, pageIndex, light:
// Get document image from the first page with white light
var documentImageWhite = results.GetGraphicFieldImageByType(EGraphicFieldType.GfDocumentImage, ERPRM_ResultType.RprmResultTypeRawImage, 0, ERPRM_Lights.RprmLightWhiteFull);
// Get document image from the first page with UV light
var documentImageUV = results.GetGraphicFieldImageByType(EGraphicFieldType.GfDocumentImage, ERPRM_ResultType.RprmResultTypeRawImage, 0, ERPRM_Lights.RprmLightUv);
// Get document image from the first page with white light
var documentImageWhite = results.GetGraphicFieldImageByType(RGLGraphicFieldType.DocumentImage, RGLResultType.RawImage, 0, RGLGraphicFieldLight.White);
// Get document image from the first page with UV light
var documentImageUV = results.GetGraphicFieldImageByType(RGLGraphicFieldType.DocumentImage, RGLResultType.RawImage, 0, RGLGraphicFieldLight.Uv);
Getting statuses
Getting statuses of graphic fields indicating imageQualityCheckType (one of ECheckResult
values):
// Get status of an image's focus
var imageFocus = results.GetQualityResult(EImageQualityCheckType.IqcImageFocus);
// Get status of images' glares
var imageGlares = results.GetQualityResult(EImageQualityCheckType.IqcImageGlares);
Getting statuses of graphic fields indicating imageQualityCheckType, securityFeature (one of ECheckResult
values):
// Get status of images' glares
var blank = results.GetQualityResult(EImageQualityCheckType.IqcImageGlares, ERPRM_SecurityFeatureType.SecurityFeatureTypeBlank);
var mrz = results.GetQualityResult(EImageQualityCheckType.IqcImageGlares, ERPRM_SecurityFeatureType.SecurityFeatureTypeMrz);
Getting instances
Getting instances of graphic fields indicating fieldType:
// Get a documentImage instance
var documentImage = results.GetGraphicFieldByType(RGLGraphicFieldType.DocumentImage);
Getting instances of graphic fields indicating fieldType, source:
DocumentReaderGraphicField graphicField = results.GetGraphicFieldByType(EGraphicFieldType.GfSignature, ERPRM_ResultType.RprmResultTypeVisualOcrExtended);
var graphicField = results.GetGraphicFieldByType(RGLGraphicFieldType.Signature, RGLResultType.VisualOCRExtended);
Getting instances of text fields indicating fieldType, source, pageIndex:
DocumentReaderGraphicField graphicField = results.GetGraphicFieldByType(EGraphicFieldType.GfSignature, ERPRM_ResultType.RprmResultTypeVisualOcrExtended, 0);
var graphicField = results.GetGraphicFieldByType(RGLGraphicFieldType.Signature, RGLResultType.VisualOCRExtended, 0);
Getting instances of text fields indicating fieldType, source, pageIndex, light:
DocumentReaderGraphicField graphicField = results.GetGraphicFieldByType(EGraphicFieldType.GfSignature, ERPRM_ResultType.RprmResultTypeVisualOcrExtended, 0, ERPRM_Lights.RprmLightWhiteFull);
var graphicField = results.GetGraphicFieldByType(RGLGraphicFieldType.Signature, RGLResultType.VisualOCRExtended, 0, RGLGraphicFieldLight.White);