Getting results

This page covers the description of how to get various kinds of 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({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES });
// Get date of birth
var dateOfBirth = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_DATE_OF_BIRTH });
// Get document number
var documentNumber = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_DOCUMENT_NUMBER });

Getting values of text fields indicating fieldType, lcid:

// Get full name
var surnameAndGivenNames = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, lcid: Regula.DocumentReader.Enum.LCID.BELARUSIAN });
// Get place of birth
var placeOfBirth = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_PLACE_OF_BIRTH, lcid: Regula.DocumentReader.Enum.LCID.GERMAN_GERMANY });

Getting values of text fields indicating fieldType, lcid, source:

// Get full name
var surnameAndGivenNames = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, lcid: Regula.DocumentReader.Enum.LCID.BELARUSIAN, source: Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED });
// Get address
var address = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_ADDRESS, lcid: Regula.DocumentReader.Enum.LCID.LATIN, source: Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA });

Getting values of text fields indicating fieldType, lcid, source, original:

// Get surname
var surname = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME, lcid: Regula.DocumentReader.Enum.LCID.BELARUSIAN, source: Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, original: true });
// Get address
var address = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_ADDRESS, lcid: Regula.DocumentReader.Enum.LCID.LATIN, source: Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_BAR_CODES_TEXT_DATA, original: true });

Getting values of text fields indicating fieldType, source:

// Get surname
var surname = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME, source: Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED });

Getting values of text fields indicating fieldType, source, original:

// Get surname
var surname = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME, source: Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED, original: true });

iOS

Getting values of text fields indicating fieldType, original:

// Get surname
var surname = results.getTextFieldValueByType({ fieldType: Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME, original: true });

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(Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES);
// Get status of FT_DATE_OF_BIRTH
var dateOfBirth = results.getTextFieldStatusByType(Regula.DocumentReader.Enum.eVisualFieldType.FT_DATE_OF_BIRTH);

Getting statuses of text fields indicating fieldType, lcid (one of eCheckResult values):

// Get status of FT_SURNAME_AND_GIVEN_NAMES
var surnameAndGivenNames = results.getTextFieldStatusByType(Regula.DocumentReader.Enum.eVisualFieldType.FT_SURNAME_AND_GIVEN_NAMES, Regula.DocumentReader.Enum.LCID.BELARUSIAN);
// Get status of FT_DATE_OF_BIRTH
var dateOfBirth = results.getTextFieldStatusByType(Regula.DocumentReader.Enum.eVisualFieldType.FT_DATE_OF_BIRTH, Regula.DocumentReader.Enum.LCID.LATIN);

Graphic Results

Getting values

Getting values of graphic fields indicating fieldType:

// Get document image
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE)
// Get portrait image
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_PORTRAIT)

Getting values of graphic fields indicating fieldType, source:

// Get document image
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE)
// Get document image (uncropped)
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_UNCROPPED_IMAGE)
// Get portrait image
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_PORTRAIT, Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS)

Getting values of graphic fields indicating fieldType, source, pageIndex:

// Get document image from the second page
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 1)
// Get portrait image from the first page
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_PORTRAIT, Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_GRAPHICS, 0)

Getting values of graphic fields indicating fieldType, source, pageIndex, light:

// Get document image from the first page with white light
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, Regula.DocumentReader.Enum.eRPRM_Lights.RPRM_LIGHT_WHITE_FULL)
// Get document image from the first page with UV light
results.getGraphicFieldImageByType(Regula.DocumentReader.Enum.eGraphicFieldType.GF_DOCUMENT_IMAGE, Regula.DocumentReader.Enum.eRPRM_ResultType.RPRM_RESULT_TYPE_RAW_IMAGE, 0, Regula.DocumentReader.Enum.eRPRM_Lights.RPRM_LIGHT_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(Regula.DocumentReader.Enum.eImageQualityCheckType.IQC_IMAGE_FOCUS);
// Get status of images' glares
var imageGlares = results.getQualityResult(Regula.DocumentReader.Enum.eImageQualityCheckType.IQC_IMAGE_GLARES);

Getting statuses of graphic fields indicating imageQualityCheckType, securityFeature (one of eCheckResult values):

// Get status of images' glares
var blank = results.getQualityResult(Regula.DocumentReader.Enum.eImageQualityCheckType.IQC_IMAGE_GLARES, Regula.DocumentReader.Enum.eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_BLANK);
var mrz = results.getQualityResult(Regula.DocumentReader.Enum.eImageQualityCheckType.IQC_IMAGE_GLARES, Regula.DocumentReader.Enum.eRPRM_SecurityFeatureType.SECURITY_FEATURE_TYPE_MRZ);