Skip to content

Handling Results

Getting Results

Text Values

To get values of text fields, invoke the getTextFieldValueByType method with the required arguments:

  • fieldType is the field logical type, one of the FieldType values. The enumeration contains identifiers determining the logical type of the text data obtained while reading MRZ, document filling fields, and barcodes.
  • lcid is the ID of language-culture to differentiate one field of the same type from another. Contains an LCID enumeration value.
  • source identifies the zone from which data should be extracted. Contains an RGLResultType enumeration value.
  • original checks which value to extract: modified or original.
// Get surname
let surname = result.getTextFieldValueByType(fieldType: .ft_Surname, lcid: .belarusian, source: .visualOCRExtended, original: true)
// Get address
let address = result.getTextFieldValueByType(fieldType: .ft_Address, lcid: .latin, source: .barCodesTextData, original: true)
// Get surname
NSString *surname = [result getTextFieldValueByType:RGLFieldTypeFt_Surname lcid:RGLLCIDBelarusian source:RGLResultTypeVisualOCRExtended original:YES];
// Get address
NSString *address = [result getTextFieldValueByType:RGLFieldTypeFt_Address lcid:RGLLCIDLatin source:RGLResultTypeBarCodesTextData original:YES];

To get instances of text fields, invoke the getTextFieldByType method with the required arguments:

  • fieldType is the field logical type, one of the FieldType values. The enumeration contains identifiers determining the logical type of the text data obtained while reading MRZ, document filling fields, and barcodes.
  • lcid is the ID of language-culture to differentiate one field of the same type from another. Contains an LCID enumeration value.
// Get a surname instance
let surname = result.getTextFieldByType(fieldType: .ft_Surname, lcid: .belarusian)
// Get a placeOfBirth instance
let placeOfBirth = result.getTextFieldByType(fieldType: .ft_Place_of_Birth, lcid: .germanGermany)
// Get a surname instance
RGLDocumentReaderTextField *surname = [result getTextFieldByType:RGLFieldTypeFt_Surname lcid:RGLLCIDBelarusian];
// Get a placeOfBirth instance
RGLDocumentReaderTextField *placeOfBirth = [result getTextFieldByType:RGLFieldTypeFt_Place_of_Birth lcid:RGLLCIDGermanGermany];

You can also go through all instances of text fields and get the required information, for example:

for textField in result.textResult.fields {
    guard let value = result.getTextFieldValueByType(fieldType: textField.fieldType, lcid: textField.lcid) else { continue }
    print("fieldName: \(textField.fieldName), value: \(value)")
}
for (RGLDocumentReaderTextField *textField in result.textResult.fields) {
    NSString *value = [result getTextFieldValueByType:textField.fieldType lcid:textField.lcid];
    NSLog(@"fieldName: %@, value: %@", textField.fieldName, value);
}

Graphic Values

To get values of graphic fields, invoke the getGraphicFieldImageByType method with the required arguments:

  • fieldType is the field logical type, one of the RGLGraphicFieldType values. The enumeration contains identifiers determining the logical type of the graphic data obtained while reading the document filling fields or barcodes.
  • source identifies the zone from which data should be extracted. The RGLResultType enumeration contains possible values.
  • pageIndex is the index of the document page from which the result is received.
  • light is the light type, one of the RGLGraphicFieldLight values. The enumeration contains a set of identifiers used for identifying the document reader possibilities, specifying lighting schemes for scanning, etc.
// Get document image from the first page with white light
result.getGraphicFieldImageByType(fieldType: .gf_DocumentImage, source: .rawImage, pageIndex: 0, light: .white)
// Get document image from the first page with UV light
result.getGraphicFieldImageByType(fieldType: .gf_DocumentImage, source: .rawImage, pageIndex: 0, light: .UV)
// Get document image from the first page with white light
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawImage pageIndex:0 light:RGLGraphicFieldLightWhite];
// Get document image from the first page with UV light
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawImage pageIndex:0 light:RGLGraphicFieldLightUV];

To get instances of graphic fields, invoke the getGraphicFieldByType method with the required arguments:

  • fieldType is the field logical type, one of the RGLGraphicFieldType values. The enumeration contains identifiers determining the logical type of the graphic data obtained while reading the document filling fields or barcodes.
  • source identifies the zone from which data should be extracted. The RGLResultType enumeration contains possible values.
  • pageIndex is the index of the document page from which the result is received.
  • light is the light type, one of the RGLGraphicFieldLight values. The enumeration contains a set of identifiers used for identifying the document reader possibilities, specifying lighting schemes for scanning, etc.
// Get a documentImage instance
let documentImage = result.getGraphicFieldByType(fieldType: .gf_DocumentImage, source: .rawImage, pageIndex: 0, light: .white)
// Get a portrait instance
let portrait = result.getGraphicFieldByType(fieldType: .gf_Portrait, source: .graphics, pageIndex: 0, light: .white)
// Get a documentImage instance
RGLDocumentReaderGraphicField *documentImage = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawImage pageIndex:0 light:RGLGraphicFieldLightWhite];
// Get a portrait instance
RGLDocumentReaderGraphicField *portrait = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_Portrait source:RGLResultTypeGraphics pageIndex:0 light:RGLGraphicFieldLightWhite];

Results Structure

Once the document processing is completed, the DocumentReaderResults instance is received.

The result contains the following result types:

documentReaderResults
└── documentType
└── textResult
└── graphicResult
└── documentPosition
└── barcodePosition
└── mrzPosition
└── imageQualityGroup
└── overallResult
└── authenticityResults
└── rfidSessionData
└── chipPage
└── resolutionType
└── barcodeResult
└── processingFinishedStatus
└── morePagesAvailable
└── elapsedTime
└── elapsedTimeRFID
└── rawResult
Result type Description
documentType The document type result.
textResult The text result.
graphicResult The graphic result.
documentPosition The position of the found Barcode.
mrzPosition The position of the MRZ area.
imageQualityGroup The image quality result.
overallResult The summary of all results, one of the RGLCheckResult enumeration values. If at least one result status is negative, the overall result is negative. DEPRECATED in DocumentReader 6.1 Use status.overallStatus instead.
authenticityResults The authenticity result.
rfidSessionData The result of work with the SDK within the context of the current communication session with an electronic document.
chipPage Indicates the presence and location of an RFID chip in a document. 0—no RFID chip; 1—the chip is located in the document data page; 2—the chip is located in the back page or inlay of the document. Requires Document Type recognition, otherwise returns 1 by default.
resolutionType The image resolution, one of the ResolutionType enumeration values.
barcodeResult The barcode result.
morePagesAvailable Indicates if a document has more pages to be processed, for example, ID card's front and back side. Requires the Document Type recognition, otherwise it is 0 by default.
elapsedTime Time the document processing has taken, ms.
elapsedTimeRFID Time the RFID chip processing has taken, ms.
rawResult The result in the initial raw view.

Document Type Result

The DocumentReaderDocumentType class contains the following parameters:

documentType
└── name
└── documentID
└── ICAOCode
└── FDSID
└── dType
└── dFormat
└── dMRZ
└── dDescription
└── dYear
└── dCountryName
└── pageIndex
Parameter Description
name The document type name.
documentID The document type numeric code.
ICAOCode The document issuing country ICAO Code.
FDSID The array of IRS document identifiers.
dType The document type, one of the DiDocType enumeration values.
dFormat The document format, one of the RGLDocFormat enumeration values.
dMRZ A flag for MRZ presence on the document.
dDescription The document description text.
dYear The year the document was issued.
dCountryName The name of the country that issued the document.
pageIndex The index of the document page from which the result is received.

Text Result

The DocumentReaderTextResult class contains the following parameters:

textResult
└── fields
|   └── fieldType
|   └── fieldName
|   └── lcid
|   └── values
|   |   └── sourceType
|   |   └── value
|   |   └── originalValue
|   |   └── boundRect
|   |   └── validity
|   |   └── comparison
|   |   └── pageIndex
|   |   └── probability
|   └── status
|   └── getValue
|   └── lcidName
└── status
Parameter Description
fieldType The field logical type, one of the FieldType values. Enumeration contains identifiers determining the logical type of the text data obtained while reading MRZ, document filling fields, and barcodes.
fieldName The title of the fieldType.
lcid The ID of language-culture to differentiate one field of the same type from another. The LCID enumeration contains available enumeration values.
sourceType Identifies the zone from which data was extracted. The RGLResultType enumeration contains enumeration values.
value The value obtained.
originalValue Checks whether a value has been modified or not and returns the original value.
boundRect The field rectangular area coordinates on the image. For the document filling fields reading, the result is located in visualOCRExtended (the RGLResultType enumeration)..
validity Identifies the verification result. The RGLFieldVerificationResult enumeration contains possible conditions.
comparison Contains a comparison result of the field value that is received from several zones, where the key is one of the RGLResultType enumeration values and the value is one of the RGLFieldVerificationResult enumeration values.
pageIndex The index of the document page from which the result is received.
probability The symbol recognition probability (0–100, %).
status Stores one of the RGLCheckResult enumeration which contains identifiers that determine the result of a single document security check.
lcidName The title of the lcid.

Graphic Result

The DocumentReaderGraphicResult class contains the following parameters:

graphicResult
└── fields
|   └── sourceType
|   └── fieldType
|   └── fieldName
|   └── boundRect
|   └── value
|   └── lightType
|   └── lightName
|   └── pageIndex
Parameter Description
sourceType Identifies the zone from which data was extracted. The RGLResultType class contains enumeration values.
fieldType The field logical type, one of the RGLGraphicFieldType values. Enumeration contains identifiers determining the logical type of the graphic data obtained while reading the document filling fields or barcodes.
fieldName The title of the fieldType.
boundRect The field rectangular area coordinates on the image. For the document filling fields reading, the result is visualOCRExtended (RGLResultType enumeration).
value The value obtained.
lightType The light type, one of the RGLGraphicFieldLight values. The enumeration contains a set of identifiers used for identifying the document reader possibilities, specifying lighting schemes for scanning, etc.
lightName The title of the lightType.
pageIndex The index of the document page from which the result is received.

Image Quality Group

The ImageQualityGroup class contains the following parameters:

imageQuality
└── count
└── result
└── imageQualityList
|   └── type
|   └── result
|   └── featureType
|   └── boundRects
Parameter Description
count The number of results in the list.
result The overall check result, one of the RGLCheckResult enumeration values.
imageQualityList

The array of single check result pointers that contains:

Barcode Result

The DocumentReaderBarcodeResult class contains the following parameters:

barcodeResult
└── fields
|   └── barcodeType
|   └── status
|   └── pdf417Info
|   |   └── errorLevel
|   |   └── columns
|   |   └── rows
|   └── data
|   └── pageIndex
Parameter Description
barcodeType The decoded barcode type, one of the RGLBarcodeType enumeration values.
status The barcode reading result, one of the RGLBarcodeResult enumeration values or another value, which is SDK internal error code.
pdf417Info

Information about the PDF417 barcode that includes the following parameters:

  • errorLevel—barcode error correction level
  • columns—number of columns in a barcode
  • rows—number of rows in a barcode
data The results of reading data from barcode modules.
pageIndex The index of the document page from which the result is received.

Document, MRZ, Barcode Position

The Position class contains the following parameters:

documentPosition / mrzPosition / barcodePosition
└── size
|   └── width
|   └── height
└── center
|   └── x
|   └── y
└── leftTop
|   └── x
|   └── y
└── leftBottom
|   └── x
|   └── y
└── rightTop
|   └── x
|   └── y
└── rightBottom
|   └── x
|   └── y
└── angle
└── perspectiveTr
└── objArea
└── objIntAngleDev
└── resultStatus
└── docFormat
└── pageIndex
└── dpi
└── inverse
Parameter Description
size The document width and height.
center The document center coordinates.
leftTop The document left top corner coordinates.
leftBottom The document left bottom corner coordinates.
rightTop The document right top corner coordinates.
rightBottom The document right bottom corner coordinates.
angle The document rotation angle.
perspectiveTr The internal use parameter.
objArea The internal use parameter.
objIntAngleDev The internal use parameter.
resultStatus The internal use parameter, one of the RGLCheckResult enumeration values.
docFormat The document format, one of the RGLDocFormat enumeration values.
pageIndex The index of the document page from which the result is received.
dpi The resolution in dots per inch.
inverse The internal use parameter.

Status

The DocumentReaderResultsStatus class contains the following parameters:

status
└── overallStatus
└── optical
└── detailsOptical
|   └── overallStatus
|   └── mrz
|   └── text
|   └── docType
|   └── security
|   └── imageQA
|   └── expiry
|   └── vds
|   └── pagesCount
└── rfid
└── detailsRFID
|   └── overallStatus
|   └── AA
|   └── BAC
|   └── CA
|   └── PA
|   └── PACE
|   └── TA
└── portrait
└── stopList
Parameter Description
overallStatus The summary of all results. RGLCheckResult.
optical The summary of all optical results. Same as detailsOptical.overallStatus. RGLCheckResult.
detailsOptical The container for an optical related scanning statuses.
overallStatus The summary of all optical results. RGLCheckResult.
mrz MRZ verification: values validity, dates, checkdigits verification. RGLCheckResult.
text Text fields valitity: values validity for specific fields, cross-comparison of values from different sources, dates & checkdigits verification. RGLCheckResult.
docType The check status if document type was recognized or not. RGLCheckResult.
security The authenticity verification status. RGLCheckResult.
imageQA The input images quality verification status. RGLCheckResult.
expiry The document validity period verification status. RGLCheckResult.
vds Theb Visible Digital Seal verification status. RGLCheckResult.
pagesCount The number of scanned document pages, integer.
rfid The summary of all RFID results. Same as detailsRFID.overallStatus. RGLCheckResult.
detailsRFID The container for the RFID related scanning statuses.
overallStatus The summary of all RFID results. RGLCheckResult.
AA The active authentication status. RGLCheckResult.
BAC The basics access control status. RGLCheckResult.
CA The chip authentication status. RGLCheckResult.
PA The passive authentication status. RGLCheckResult.
PACE The password authenticated connection establishment status. RGLCheckResult.
TA The terminal authentication status. RGLCheckResult.
portrait The comparison status for portrait in the document against the live or external image. RGLCheckResult.
stopList The verification status for the document data against the database. RGLCheckResult.

Authenticity Result

The RGLDocumentReaderAuthenticityResult class contains the following parameters:

authenticityResults
└── status
└── checks
|   └── type
|   └── typeName
|   └── status
|   └── elements
|   |   └── status
|   |   └── elementType
|   |   └── elementTypeName
|   |   └── elementDiagnose
|   |   └── elementDiagnoseName
|   └── pageIndex
Parameter Description
status The overall check result, one of the RGLCheckResult enumeration values.
checks Stores the result of the document authenticity check using the images for different lighting schemes.
type The type of the performed check, one of the RGLAuthenticity enumeration values.
typeName The title of type.
elementType The element type, one of the SecurityFeatureType enumeration values.
elementTypeName The title of the elementType.
elementDiagnose The element diagnose, one of the RGLCheckDiagnose enumeration values.
elementDiagnoseName The title of the elementDiagnose.
pageIndex The index of the document page from which the result is received.

RFID Result

The RFIDSessionData class contains the following parameters:

rfidSessionData
└── accessControls
|   └── activeOptionIdx
|   └── notifications
|   └── status
|   └── type
└── applications
|   └── applicationID
|   └── dataHashAlgorithm
|   └── files
|   |   └── fileData
|   |   |   └── data
|   |   |   └── length
|   |   |   └── status
|   |   |   └── type
|   |   └── fileID
|   |   └── notifications
|   |   └── pAStatus
|   |   └── readingStatus
|   |   └── readingTime
|   |   └── type
|   |   └── typeName
|   |   └── docFieldsText
|   |   └── docFieldsGraphics
|   |   └── docFieldsOriginals
|   |   └── certificates
|   |   |   └── securityObject
|   |   |   |   └── data
|   |   |   |   └── length
|   └── type
|   └── status
|   └── unicodeVersion
|   └── version
└── securityObjects
|   └── fileReference
|   └── objectType
|   └── version
|   └── signerInfos
|   |   └── dataToHash
|   |   └── digestAlgorithm
|   |   └── paStatus
|   |   └── signatureAlgorithm
|   |   └── version
|   |   └── issuer
|   |   |   └── attributes
|   |   |   |   └── type
|   |   |   |   └── value
|   |   |   |   |   └── data
|   |   |   |   |   └── length
|   |   |   |   |   └── status
|   |   |   |   |   └── type
|   |   |   |   |   └── format
|   |   |   └── data
|   |   |   └── friendlyName
|   |   |   |   └── data
|   |   |   |   └── length
|   |   |   |   └── status
|   |   |   |   └── type
|   |   |   |   └── format
|   |   └── serialNumber
|   |   |   └── data
|   |   |   └── length
|   |   |   └── status
|   |   |   └── type
|   |   |   └── format
|   |   └── signature
|   |   |   └── data
|   |   |   └── length
|   |   |   └── status
|   |   |   └── type
|   |   |   └── format
|   |   └── signedAttributes
|   |   |   └── data
|   |   |   └── type
|   |   └── subjectKeyIdentifier
|   |   |   └── data
|   |   |   └── length
|   |   |   └── status
|   |   |   └── type
|   |   |   └── format
|   |   └── certificateChain
|   |   |   └── extensions
|   |   |   |   └── data
|   |   |   |   └── type
|   |   |   └── fileName
|   |   |   |   └── data
|   |   |   |   └── length
|   |   |   |   └── status
|   |   |   |   └── type
|   |   |   |   └── format
|   |   |   └── issuer
|   |   |   |   └── attributes
|   |   |   |   |   └── type
|   |   |   |   |   └── value
|   |   |   |   |   |   └── data
|   |   |   |   |   |   └── length
|   |   |   |   |   |   └── status
|   |   |   |   |   |   └── type
|   |   |   |   |   |   └── format
|   |   |   |   └── data
|   |   |   |   └── friendlyName
|   |   |   |   |   └── data
|   |   |   |   |   └── length
|   |   |   |   |   └── status
|   |   |   |   |   └── type
|   |   |   |   |   └── format
|   |   |   └── notifications
|   |   |   └── origin
|   |   |   └── paStatus
|   |   |   └── serialNumber
|   |   |   └── signatureAlgorithm
|   |   |   └── subject
|   |   |   |   └── attributes
|   |   |   |   |   └── type
|   |   |   |   |   └── value
|   |   |   |   |   |   └── data
|   |   |   |   |   |   └── length
|   |   |   |   |   |   └── status
|   |   |   |   |   |   └── type
|   |   |   |   |   |   └── format
|   |   |   |   └── data
|   |   |   |   └── friendlyName
|   |   |   |   |   └── data
|   |   |   |   |   └── length
|   |   |   |   |   └── status
|   |   |   |   |   └── type
|   |   |   |   |   └── format
|   |   |   └── subjectPKAlgorithm
|   |   |   └── type
|   |   |   └── validity
|   |   |   |   └── notAfter
|   |   |   |   |   └── data
|   |   |   |   |   └── length
|   |   |   |   |   └── status
|   |   |   |   |   └── type
|   |   |   |   |   └── format
|   |   |   |   └── notBefore
|   |   |   |   |   └── data
|   |   |   |   |   └── length
|   |   |   |   |   └── status
|   |   |   |   |   └── type
|   |   |   |   |   └── format
|   |   |   └── version
|   |   └── notifications
|   └── notifications
└── cardProperties
|   └── aTQA
|   └── aTQB
|   └── aTR
|   └── baudrate1
|   └── baudrate2
|   └── bitRateR
|   └── bitRateS
|   └── chipTypeA
|   └── mifareMemory
|   └── rfidType
|   └── sAK
|   └── support4
|   └── supportMifare
|   └── uID
└── totalBytesReceived
└── totalBytesSent
└── status
└── extLeSupport
└── processTime
└── sessionDataStatus
|   └── AA
|   └── BAC
|   └── CA
|   └── PA
|   └── PACE
|   └── TA
|   └── overallStatus
Parameter Description
accessControls The list of containers that store information about the supported procedures of authentication and secure data access within the context of the session.
activeOptionIdx The index of the active variant of the procedure.
notifications The list of remarks occured during the procedure.
status The procedure status (RFID_Error_NotPerformed, RFID_Error_NotAvailable, RFID_Error_NoError or the error code from the eRFID_NotificationAndErrorCodes enumeration).
type The procedure type (one of the eRFID_AccessControl_ProcedureType enumeration values).
applications The list of containers that store information about the involved applications of an electronic document.
applicationID The application identifier.
dataHashAlgorithm The algorithm for calculating hash values for files for the procedure of PA.
files The list of containers that store information about the read files of the application.
unicodeVersion The unicode version for application.
securityObjects The list of containers that store information about the detected document security objects.
fileReference The reference to the source file of the security object data.
objectType The security object identifier.
signerInfos The list of containers that store information about the digital signature objects contained in the SO.
digestAlgorithm The digital signature hash-function algorithm identifier.
paStatus The result of the digital signature verification (RFID_Error_NotPerformed, RFID_Error_NoError or RFID_Error_Failed).
signatureAlgorithm The digital signature algorithm identifier.
issuer The identifier of the necessary certificate issuer.
serialNumber The serial number of the necessary certificate.
signature The binary data of the verified digital signature.
signedAttributes The list of the signed attributes.
subjectKeyIdentifier Thde signature object identifier of the necessary certificate.
certificateChain The certificate chain, used for the digital signature verification.
cardProperties The set of the electronic document chip characteristics.
aTQA The numeric ATQ_A value in hexadecimal format, for example, "0x0000".
aTQB ATQ_B contents in text format. Each byte is represented by its hexadecimal value. The individual bytes are separated by spaces, for example, "50 F9 4F 41 60 00 00 00 00 77 81 81".
aTR pAtr contents in text format. Each byte is represented by its hexadecimal value. The individual bytes are separated by spaces, for example, "3B 88 81 11 FC 00 00 00 00 77 81 81 00 93".
baudrate1 The numeric Baudrate1 value in hexadecimal format, for example, "0x0000000F".
baudrate2 The numeric Baudrate2 value in hexadecimal format.
bitRateR The numeric BitRateR value in hexadecimal format, for example, "0x04".
bitRateS The numeric BitRateS value in hexadecimal format, for example, "0x04".
chipTypeA The text abbreviation of ChipType_A value.
mifareMemory The numeric MifareMemory value.
rfidType The text abbreviation of the RFID_Type value.
sAK The numeric SAK value in hexadecimal format, for example, "0x00".
support4 The boolean Support_4 value.
supportMifare The boolean Support_Mifare value.
uID UID contents in text format. Each byte is represented by its hexadecimal value. The individual bytes are separated by spaces, for example, "F9 4F 41 60".
totalBytesReceived The total number of bytes received from the RFID-chip during the whole session.
totalBytesSent The total number of bytes transmitted to the RFID-chip during the whole session.
extLeSupport The sign of support of RFID-chip for extended length commands of reading (RFID_Error_NotPerformed, RFID_Error_NotAvailable or RFID_Error_NoError).
processTime The total time of all operations performed during the session, ms.
AA The AA status, one of the RGLCheckResult values.
BAC The BAC status, one of the RGLCheckResult values.
CA The CA status, one of the RGLCheckResult values.
PA The PA status, one of the RGLCheckResult values.
PACE The PACE status, one of the RGLCheckResult values.
TA The TA status, one of the RGLCheckResult values.
overallStatus The overall status, one of the RGLCheckResult values.

VDSNCData. Visible Digital Seal for Non Constrained environments.

The VDSNCData class contains the following parameters:

vdsncData
└── type
└── version
└── issuingCountry
└── message
└── signatureAlgorithm
└── signature
└── certificate
└── certificateChain
└── notifications
Parameter Description
type The Visible Digital Seal use case type. Type is set to icao.test for Proof of Testing (data defined by CAPSCA), icao.vacc for Proof of Vaccination (data defined by WHO). Other Types may be added in the future.
version The Visible Digital Seal use case version.
issuingCountry Three letter code identifying the issuing state or organization.
message The message field contains the actual data as a dictionary (JSON).
signatureAlgorithm The signature algorithm used to produce the signature. ECDSA scheme.
signature The binary data of the verified digital signature.
certificate The binary data of the signer certificate.
certificateChain The сertificate chain, used for the digital signature verification.
notifications The list of remarks occured during the scanning procedure. Each element is a NSNumber containing a NSUInteger, that belongs to the enum eLDS_ParsingErrorCodes or the enum eLDS_ParsingNotificationCodes.

Next Steps