Skip to content

Getting Results

On this page, find out how to get different kinds of text and graphic results. If you know exactly what text data you need, use special functions to get the information.

Text Values

To get values of text fields, you can indicate the following parameters:

// Get full name
let surnameAndGivenNames = result.getTextFieldValueByType(fieldType: .ft_Surname_And_Given_Names)
// Get date of birth
let dateOfBirth = result.getTextFieldValueByType(fieldType: .ft_Date_of_Birth)
// Get document number
let documentNumber = result.getTextFieldValueByType(fieldType: .ft_Document_Number)
// Get full name
NSString *surnameAndGivenNames = [resultInstance getTextFieldValueByType:RGLFieldTypeFt_Surname_And_Given_Names];
// Get date of birth
NSString *dateOfBirth = [resultInstance getTextFieldValueByType:RGLFieldTypeFt_Date_of_Birth];
// Get document number
NSString *documentNumber = [resultInstance getTextFieldValueByType:RGLFieldTypeFt_Document_Number];
// Get full name
let surnameAndGivenNames = result.getTextFieldValueByType(fieldType: .ft_Surname_And_Given_Names, lcid: .belarusian)
// Get place of birth
let placeOfBirth = result.getTextFieldValueByType(fieldType: .ft_Place_of_Birth, lcid: .germanGermany)
// Get full name
NSString *surnameAndGivenNames = [result getTextFieldValueByType:RGLFieldTypeFt_Surname_And_Given_Names lcid:RGLLCIDBelarusian];
// Get place of birth
NSString *placeOfBirth = [result getTextFieldValueByType:RGLFieldTypeFt_Place_of_Birth lcid:RGLLCIDGermanGermany];
// Get full name
let surnameAndGivenNames = result.getTextFieldValueByType(fieldType: .ft_Surname_And_Given_Names, lcid: .belarusian, source: .visualOCRExtended)
// Get address
let address = result.getTextFieldValueByType(fieldType: .ft_Address, lcid: .latin, source: .barCodesTextData)
// Get full name
NSString *surnameAndGivenNames = [result getTextFieldValueByType:RGLFieldTypeFt_Surname_And_Given_Names lcid:RGLLCIDBelarusian source:RGLResultTypeVisualOCRExtended];
// Get address
NSString *address = [result getTextFieldValueByType:RGLFieldTypeFt_Address lcid:RGLLCIDLatin source:RGLResultTypeBarCodesTextData];
// 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];
// Get surname
let surname = result.getTextFieldValueByType(fieldType: .ft_Surname, source: .visualOCRExtended)
// Get surname
NSString *surname = [result getTextFieldValueByType:RGLFieldTypeFt_Surname source:RGLResultTypeVisualOCRExtended];
// Get surname
let surname = result.getTextFieldValueByType(fieldType: .ft_Surname, source: .visualOCRExtended, original: true)
// Get surname
NSString *surname = [result getTextFieldValueByType:RGLFieldTypeFt_Surname source:RGLResultTypeVisualOCRExtended original:YES];
// Get surname
let surname = result.getTextFieldValueByType(fieldType: .ft_Surname, original: true)
// Get surname
NSString *surname = [result getTextFieldValueByType:RGLFieldTypeFt_Surname original:YES];

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);
}

Text Instances

To get instances of text fields, you can indicate:

// Get a surname instance
let surname = result.getTextFieldByType(fieldType: .ft_Surname)
// Get an address instance
let address = result.getTextFieldByType(fieldType: .ft_Address)
// Get a surname instance
RGLDocumentReaderTextField *surname = [result getTextFieldByType:RGLFieldTypeFt_Surname];
// Get an address instance
RGLDocumentReaderTextField *address = [result getTextFieldByType:RGLFieldTypeFt_Address];
// 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];

Graphic Values

To get values of graphic fields, you can indicate the following parameters:

// Get document image
result.getGraphicFieldImageByType(fieldType: .gf_DocumentImage)
// Get portrait image
result.getGraphicFieldImageByType(fieldType: .gf_Portrait)
// Get document image
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_DocumentImage];
// Get portrait image
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_Portrait];
// Get document image
result.getGraphicFieldImageByType(fieldType: .gf_DocumentImage, source: .rawImage)
// Get document image (uncropped)
result.getGraphicFieldImageByType(fieldType: .gf_DocumentImage, source: .rawUncroppedImage)
// Get portrait image
result.getGraphicFieldImageByType(fieldType: .gf_Portrait, source: .graphics)
// Get document image
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawImage];
// Get document image (uncropped)
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawUncroppedImage];
// Get portrait image
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_Portrait source:RGLResultTypeGraphics];
// Get document image from the second page
result.getGraphicFieldImageByType(fieldType: .gf_DocumentImage, source: .rawImage, pageIndex: 1)
// Get portrait image from the first page
result.getGraphicFieldImageByType(fieldType: .gf_Portrait, source: .graphics, pageIndex: 0)
// Get document image from the second page
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawImage pageIndex:1];
// Get portrait image from the first page
[result getGraphicFieldImageByType:RGLGraphicFieldTypeGf_Portrait source:RGLResultTypeGraphics pageIndex:0];
// 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];

Graphic Instances

To get instances of graphic fields, indicate:

// Get a documentImage instance
let documentImage = result.getGraphicFieldByType(fieldType: .gf_DocumentImage)
// Get a portrait instance
let portrait = result.getGraphicFieldByType(fieldType: .gf_Portrait)
// Get a documentImage instance
RGLDocumentReaderGraphicField *documentImage = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_DocumentImage];
// Get a portrait instance
RGLDocumentReaderGraphicField *portrait = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_Portrait];
// Get a documentImage instance
let documentImage = result.getGraphicFieldByType(fieldType: .gf_DocumentImage, source: .rawImage)
// Get a portrait instance
let portrait = result.getGraphicFieldByType(fieldType: .gf_Portrait, source: .graphics)
// Get a documentImage instance
RGLDocumentReaderGraphicField *documentImage = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawImage];
// Get a portrait instance
RGLDocumentReaderGraphicField *portrait = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_Portrait source:RGLResultTypeGraphics];
// Get a documentImage instance
let documentImage = result.getGraphicFieldByType(fieldType: .gf_DocumentImage, source: .rawImage, pageIndex: 0)
// Get a portrait instance
let portrait = result.getGraphicFieldByType(fieldType: .gf_Portrait, source: .graphics, pageIndex: 0)
// Get a documentImage instance
RGLDocumentReaderGraphicField *documentImage = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_DocumentImage source:RGLResultTypeRawImage pageIndex:0];
// Get a portrait instance
RGLDocumentReaderGraphicField *portrait = [result getGraphicFieldByType:RGLGraphicFieldTypeGf_Portrait source:RGLResultTypeGraphics pageIndex:0];
// 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];
Back to top