Custom settings
Contents
Process Params
Document processing
Multipage Processing
Multipage processing allows to read more than one page. Turn on/off multipage:
DocumentReader.setConfig({
"processParams": {"multipageProcessing": true}
});
Info
If multipage processing is enabled, the SDK processes the front side of the document recognizes document type and checks in the database how many pages are available for this document. If there are any child documents (second page, back side) for this document type, multipage processing is triggered. It concerns scenarios which recognize document type.
The only exception is MrzAndLocate and Locate scenarios. In this case, if SDK detects an ID1-sized document, it will ask for the second page. Multi-page processing is not triggered for documents of other formats.
Double-page spread processing
Allows to process up to two pages of the document (so-called "a double-page spread") for one-shot if they are presented on the frame (image):
Info
This option is available for the following scenarios: DocType, Ocr, FullProcess, MrzOrBarcodeOrOcr, MrzOrOcr, LocateVisual_And_MrzOrOcr.
DocumentReader.setConfig({
"processParams": {"doublePageSpread": true}
});
Authenticity
Allows you to define whether a document's holograms have to be checked:
DocumentReader.setConfig({
"processParams": {"checkHologram": true}
});
Timeouts
Allows you to set the time limit for document recognition (in seconds), beyond which the recognition does not continue regardless of its result. The countdown starts from the moment the scenario starts:
DocumentReader.setConfig({
"processParams": {"timeout": 20.0}
});
Allows you to set the time limit for document recognition (in seconds), beyond which the recognition does not continue regardless of its result. The countdown starts from the moment the document is detected:
DocumentReader.setConfig({
"processParams": {"timeoutFromFirstDetect": 5.0}
});
Allows you to set the time limit for document recognition (in seconds), beyond which the recognition does not continue regardless of its result. The countdown starts from the moment the document type is recognized:
DocumentReader.setConfig({
"processParams": {"timeoutFromFirstDocType": 3.0}
});
Display formats
You can change the format string of displayed dates in the results. Mask examples: "dd/mm/yyyy", "mm/dd/yyyy", "dd-mm-yyyy", "mm-dd-yyyy", "dd/mm/yy":
DocumentReader.setConfig({
"processParams": {"dateFormat": "dd-mm-yy"}
});
If you want to change the measure system, use one of the RGLMeasureSystem
members:
DocumentReader.setConfig({
"processParams": {"measureSystem": RGLMeasureSystem.METRIC}
});
Logs
If set, Core logs will be written to the console:
DocumentReader.setConfig({
"processParams": {"logs": true}
});
If set, deep logs will be saved (in case of reading problems). Turn on/off logs saving:
DocumentReader.setConfig({
"processParams": {"debugSaveLogs": true}
});
If set, input images will be saved (in case of reading problems). Turn on/off images saving:
DocumentReader.setConfig({
"processParams": {"debugSaveImages": true}
});
If set, input images will be cropped and saved. Turn on/off image saving:
DocumentReader.setConfig({
"processParams": {"debugSaveCroppedImages": true}
});
Allows to save RFID session data to the file in binary format:
DocumentReader.setConfig({
"processParams": {"debugSaveRFIDSession": true}
});
Scenario
Set proper scenario. You can find information of how to get available scenarios here:
DocumentReader.setConfig({
"processParams": {"scenario": ScenarioIdentifier.SCENARIO_BARCODE}
});
You can assign a scenario to the Capture button. This scenario will be used if you press the button:
DocumentReader.setConfig({
"processParams": {"captureButtonScenario": ScenarioIdentifier.SCENARIO_LOCATE}
});
Barcode types
Set the types of barcodes that you wish to process:
DocumentReader.setConfig({
"processParams": {"barcodeTypes": [BarcodeType.PDF417, BarcodeType.QRCODE]}
});
There are documents that contain barcodes which data can be parsed only if document type verification is performed. The following property allows setting the barcode parser type which should be used during recognition. It allows parsing barcode data without performing document type verification:
DocumentReader.setConfig({
"processParams": {"barcodeParserType": 123}
});
Filters
Set the list of the document ID's to process. All documents will be processed, if empty:
DocumentReader.setConfig({
"processParams": {"documentIDList": [-274257313, -2004898043]}
});
If you read document which contains MRZ, all fields will be extracted. If you read document with OCR, you can set the list of field types that you wish to extract, other fields will be skipped during processing. All fields will be extracted, if the fieldTypesFilter is empty:
DocumentReader.setConfig({
"processParams": {"fieldTypesFilter": [eVisualFieldType.FT_DATE_OF_EXPIRY]}
});
If set, in case required fields are not read, their values will be empty:
DocumentReader.setConfig({
"processParams": {"checkRequiredTextFields": true}
});
Detection
If you enable this parameter, document focus check will be omitted:
DocumentReader.setConfig({
"processParams": {"disableFocusingCheck": true}
});
Allows you to set the maximum value of the deviation of the corners of the document from the value of 90 degrees:
DocumentReader.setConfig({
"processParams": {"perspectiveAngle": 5}
});
Output images
If set, an original (uncropped) image will be received, which is sent to Core for processing:
DocumentReader.setConfig({
"processParams": {"returnUncroppedImage": true}
});
Allows to build an integral image, taking into account the quality of fixation of each of the individual images:
DocumentReader.setConfig({
"processParams": {"integralImage": true}
});
Allows you to set the minimum acceptable DPI value:
DocumentReader.setConfig({
"processParams": {"minDPI": 100}
});
If set, an image with cropped barcode will be returned:
DocumentReader.setConfig({
"processParams": {"returnCroppedBarcode": true}
});
Custom params
Allows to transfer custom JSON to Core, which should be processed:
DocumentReader.setConfig({
"processParams": {
"customParams": {
"dePersonalize": [
{"allTextFields": true},
{"allGraphicFields": true}
]
}
}
});
Bounds
Allows you to manually set the document's bounds:
DocumentReader.setConfig({
"processParams": {"manualCrop": true}
});
Functionality
Camera Frame
Set this setting to override default cropping frame on camera activity provided by scenario using one of DocReaderFrame
members:
DocumentReader.setConfig({
"functionality": {"cameraFrame": DocReaderFrame.MAX}
});
Warning
Frame is cropped by camera frame. If you set the camera frame to full screen, Core will crop frame by phone borders. Using this setting may lead to lower performance because of huge frame size. Any changes which are connected with camera frame alter scanning process. You can also set the camera frame width.
Buttons
Show/hide torch button:
DocumentReader.setConfig({
"functionality": {"showTorchButton": true}
});
Show/hide close button:
DocumentReader.setConfig({
"functionality": {"showCloseButton": true}
});
Info
You can close camera view manually using stopScanner().
Capture allows to take picture and process as a single frame. Show/hide capture button:
DocumentReader.setConfig({
"functionality": {"showCaptureButton": true}
});
You can set the time interval when Capture button should be displayed after the document is detected. 5 seconds is used by default:
DocumentReader.setConfig({
"functionality": {"showCaptureButtonDelayFromDetect": 5}
});
Warning
To use this setting you should enable the showCaptureButton parameter.
You can set the time interval when Capture button should be displayed after the scanning process is started. 10 seconds is used by default:
DocumentReader.setConfig({
"functionality": {"showCaptureButtonDelayFromStart": 10}
});
Warning
To use this setting you should enable the showCaptureButton parameter.
If set, frame expanding button will be shown on video capture screen. Show/hide change frame button:
DocumentReader.setConfig({
"functionality": {"showChangeFrameButton": true}
});
Show/hide skip next page button:
DocumentReader.setConfig({
"functionality": {"showSkipNextPageButton": true}
});
Show/hide the button for switching between cameras during processing:
DocumentReader.setConfig({
"functionality": {"showCameraSwitchButton": true}
});
Allows you to disable all validations of having a torch in case Android returns that it's not available, but it can be used when checks are skipped:
Danger
Please use this setting at your own risk as the end app may crash.
DocumentReader.setConfig({
"functionality": {"isCameraTorchCheckDisabled": true}
});
Detection
Document Reader will receive data from Motion Sensor and pause scanning when device is moving. Turn on/off video capture motion control:
DocumentReader.setConfig({
"functionality": {"videoCaptureMotionControl": true}
});
If set, scanning will be paused while camera is focusing (it can decrease camera processing speed):
DocumentReader.setConfig({
"functionality": {"skipFocusingFrames": true}
});
Orientation
Defines orientation of activities:
DocumentReader.setConfig({
"functionality": {
"orientation": Platform.isIOS
? UIInterfaceOrientationMask.Portrait
: DocReaderOrientation.PORTRAIT
}
});
Danger
Make sure that selected orientation corresponds to your application’s orientation. Otherwise, it may lead to unexpected behavior.
Scanning modes
Allows you to set the scanning mode:
DocumentReader.setConfig({
"functionality": {"captureMode": CaptureMode.CAPTURE_VIDEO}
});
If set, as soon as document is located during video mode, picture will be taken and processed as single frame. It is used for devices with poor-quality video preview:
DocumentReader.setConfig({
"functionality": {"pictureOnBoundsReady": true}
});
Allows you to control in the multipage processing mode:
Info
Do not use multipageProcessing and this one at the same time.
DocumentReader.setConfig({
"functionality": {"manualMultipageMode": true}
});
Video settings
Set the frame resolution, i.e. camera preview size:
DocumentReader.setConfig({
"functionality": {"cameraSize": { "width": 1920, "height": 1080 }}
});
DocumentReader.setConfig(jsonEncode({
"functionality": {"videoSessionPreset": AVCaptureSessionPreset.Hd1920x1080}
}));
Allows you to set a camera API:
DocumentReader.setConfig({
"functionality": {"cameraMode": CameraMode.CAMERA2}
});
Allows you to set a list of devices that must not use the camera2 API:
DocumentReader.setConfig({
"functionality": {"excludedCamera2Models": ["Redmi 6A"]}
});
If set, allows you to adjust a zoom level using the pinch gesture (its range from 1x to 10x):
DocumentReader.setConfig({
"functionality": {"isZoomEnabled": true}
});
Allows you to set the desired zoom level (its range from 1x to 10x):
DocumentReader.setConfig({
"functionality": {"zoomFactor": 2.0}
});
Allows you to record the scanning process:
DocumentReader.setConfig({
"functionality": {"recordScanningProcess": true}
});
Single Result
If set, the result will be displayed as soon as it is received:
DocumentReader.setConfig({
"functionality": {"singleResult": true}
});
Capture Device Position
You can specify the position of a capture device for video session:
DocumentReader.setConfig({
"functionality": {"cameraPosition": AVCaptureDevicePosition.Front}
});
Extra info
If set, the metadata will be displayed over the camera preview during document processing, namely the perspective angle value:
DocumentReader.setConfig({
"functionality": {"displayMetadata": true}
});
Customization
Camera Frame
Set thickness of document bounds border on the video preview (dp):
DocumentReader.setConfig({
"customization": {"cameraFrameBorderWidth": 20}
});
Hex string of document bounds border color in default state:
DocumentReader.setConfig({
"customization": {"cameraFrameDefaultColor": "#e02712"}
});
Hex string of document bounds border color in document detected state:
DocumentReader.setConfig({
"customization": {"cameraFrameActiveColor": "#3812e0"}
});
Defines the shape of document bounds border. Use one of FrameShapeType
members:
DocumentReader.setConfig({
"customization": {"cameraFrameShapeType": FrameShapeType.CORNER}
});
Defines the length (dp) of the corner side in shape modeFrameShapeType.Corner
:
DocumentReader.setConfig({
"customization": {"cameraFrameLineLength": 20}
});
Warning
Frame is cropped by camera frame. Any changes with camera frame may alter scanning process. You can change the default camera frame view, even remove it. Discover Functionality page to find out how to do it.
Allows to change the corners' radius of the camera frame:
=== "Dart"
DocumentReader.setConfig({
"customization": {"cameraFrameCornerRadius": 20}
});
Allows to customize the beginning and ending of stroked lines of the camera frame:
DocumentReader.setConfig({
"customization": {"cameraFrameLineCap": LineCap.Round}
});
Allows to specify the offsetWidth for the camera frame (only for the portrait orientation):
DocumentReader.setConfig({
"customization": {"cameraFrameOffsetWidth": 50}
});
Allows to change the aspect ratio of the camera frame for portrait mode:
DocumentReader.setConfig({
"customization": {"cameraFramePortraitAspectRatio": 1.0}
});
Allows to change the aspect ratio of the camera frame for landscape mode:
DocumentReader.setConfig({
"customization": {"cameraFrameLandscapeAspectRatio": 1.0}
});
Allows to change the position of the camera frame vertically:
DocumentReader.setConfig({
"customization": {"cameraFrameVerticalPositionMultiplier": 0.5}
});
Buttons
Allows to change the Torch button's icon for both ON and OFF states:
DocumentReader.setConfig({
"customization": {
"torchButtonOnImage": "Base64String", //For the ON state
"torchButtonOffImage": "Base64String" // For the OFF state
}
});
Allows to change the Close button's icon:
DocumentReader.setConfig({
"customization": {"closeButtonImage": "Base64String"}
});
Allows to change the Capture button's icon:
DocumentReader.setConfig({
"customization": {"captureButtonImage": "Base64String"}
});
Allows to change the Change Frame button's icon for both ON and OFF states:
DocumentReader.setConfig({
"customization": {
"changeFrameButtonExpandImage": "Base64String", //For the ON state
"changeFrameButtonCollapseImage": "Base64String" // For the OFF state
}
});
Allows to change the Camera Switch button's icon:
DocumentReader.setConfig({
"customization": {"cameraSwitchButtonImage": "Base64String"}
});
Allows you to change the size of the toolbar (the area where the buttons are located):
DocumentReader.setConfig({
"customization": {"toolbarSize": 46.0}
});
Status Message
Set a status message next to the frame:
DocumentReader.setConfig({
"customization": {"status": "Hello"}
});
Turn on/off status message:
DocumentReader.setConfig({
"customization": {"showStatusMessages": true}
});
Set the text font for the status message, so-called hint message:
DocumentReader.setConfig({
"customization": {"statusTextFont": "Avenir-HeavyOblique"}
});
Set a font style to the status message:
DocumentReader.setConfig({
"customization": {"statusTextFontStyle": FontStyle.BOLD}
});
Info
Make sure that statusTextFont is set, otherwise the default value is used.
Size of main text status (sp):
DocumentReader.setConfig({
"customization": {"statusTextSize": 16}
});
Hex string of main text status color:
DocumentReader.setConfig({
"customization": {"statusTextColor": "#e02712"}
});
Hex string of current text status background color:
DocumentReader.setConfig({
"customization": {"statusBackgroundColor": "#32a852"}
});
Allows you to change the location of the status. For example, if you set the multiplier to 0.5 and the number of pixels by vertical is equal to 800, your message will be centralized and located at 200 px from top, i.e. (800 / 2) * 0.5 = 200 px. If multiplier is equal to 1, the message will be centered. If multiplier is equal to zero, default location will be used:
DocumentReader.setConfig({
"customization": {"statusPositionMultiplier": 0.5}
});
Result Status Message
Set a result status message next to the frame:
=== "Dart"
```dart
DocumentReader.setConfig({
"customization": {"resultStatus": "Hello"}
});
```
Turn on/off result status message:
DocumentReader.setConfig({
"customization": {"showResultStatusMessages": true}
});
Set the text font for the current status:
DocumentReader.setConfig({
"customization": {"resultStatusTextFont": "Avenir-HeavyOblique"}
});
Set a font style to the result status message:
DocumentReader.setConfig({
"customization": {"resultStatusTextFontStyle": FontStyle.BOLD}
});
Info
Make sure that resultStatusTextFont is set, otherwise the default value is used.
Set the size of current text status (sp):
DocumentReader.setConfig({
"customization": {"resultStatusTextSize": 16}
});
Hex string of current text status color:
DocumentReader.setConfig({
"customization": {"resultStatusTextColor": "#e02712"}
});
Hex string of current text status background color:
DocumentReader.setConfig({
"customization": {"resultStatusBackgroundColor": "#3812e0"}
});
Allows you to change the location of the results status. For example, if you set the multiplier to 0.5 and the number of pixels by vertical is equal to 800, your message will be centralized and located at 200 px from top, i.e. (800 / 2) * 0.5 = 200 px. If multiplier is equal to 1, the message will be centered. If multiplier is equal to zero, default location will be used:
DocumentReader.setConfig({
"customization": {"resultStatusPositionMultiplier": 0.5}
});
Custom Status Message
Allows to create a custom status:
DocumentReader.setConfig({
"customization": {"customLabelStatus": "Hello, world!"}
});
Allows you to change the location of the custom status. For example, if you set the multiplier to 0.5 and the number of pixels by vertical is equal to 800, your message will be centralized and located at 200 px from top, i.e. (800 / 2) * 0.5 = 200 px. If multiplier is equal to 1, the message will be centered. If multiplier is equal to zero, default location will be used:
DocumentReader.setConfig({
"customization": {"customStatusPositionMultiplier": 0.5}
});
Animation
If set, animation showing how to position document will be displayed. Show/hide help animation:
DocumentReader.setConfig({
"customization": {"showHelpAnimation": true}
});
You can set image for the help animation. If not set, default image will be used:
DocumentReader.setConfig({
"customization": {"helpAnimationImage": "Base64String"}
});
If set, expecting page turn animation will be shown. Turn on/off next page animation:
DocumentReader.setConfig({
"customization": {"showNextPageAnimation": true}
});
You can set front image for the multipage animation. If not set, default image will be used:
DocumentReader.setConfig({
"customization": {"multipageAnimationFrontImage": "Base64String"}
});
You can set a back image for the multipage animation. If not set, default image will be used:
DocumentReader.setConfig({
"customization": {"multipageAnimationBackImage": "Base64String"}
});
Visual Elements
Hex string of visual elements color (one for all):
DocumentReader.setConfig({
"customization": {"tintColor": "#e02712"}
});
Skip Button
Set the background color to the multipage button:
DocumentReader.setConfig({
"customization": {"multipageButtonBackgroundColor": "#e02712"}
});
Loading Indicator
Hex string of loading indicator(s) color. You can see it if you press the capture button:
DocumentReader.setConfig({
"customization": {"activityIndicatorColor": "#3812e0"}
});
Background
If set, background will be darkened around the document detection frame. Show/hide background mask:
DocumentReader.setConfig({
"customization": {"showBackgroundMask": true}
});
Allows to change the intensity of the background mask:
DocumentReader.setConfig({
"customization": {"backgroundMaskAlpha": 0.5}
});
Allows to set image within camera frame:
DocumentReader.setConfig({
"customization": {"borderBackgroundImage": "Base64String"}
});
iOS
Allows to change the content mode of image, which is located within camera frame, use one of UIViewContentMode
members:
DocumentReader.setConfig({
"customization": {"borderBackgroundImageContentMode": UIViewContentMode.ScaleAspectFit}
});
RFID
Allows you to automatically change the scenario settings depending on the type and results obtained during scanning of the last document. Default value is true:
DocumentReader.setRfidScenario({
"autoSettings": true
});
Allows to set an authentication procedure type, conducting which is expected in the presence of all the objective conditions:
DocumentReader.setRfidScenario({
"authProcType": eRFID_AuthenticationProcedureType.aptAdvanced
});
Allows to set a type of priority mechanism for organizing SM-channel (Security Messaging - a mechanism of protected data exchanging):
DocumentReader.setRfidScenario({
"baseSMProcedure": eRFID_AccessControl_ProcedureType.ACPT_BAC
});
Allows to set a data access type for PACE procedure:
DocumentReader.setRfidScenario({
"pacePasswordType": eRFID_Password_Type.PPT_MRZ
});
Priority of using DS-certificates:
DocumentReader.setRfidScenario({
"pkdDSCertPriority": false
});
Use of CSCA-certificates submitted by individual data files only:
DocumentReader.setRfidScenario({
"pkdUseExternalCSCA": false
});
Level of trust to CSCA-certificates from PKD:
DocumentReader.setRfidScenario({
"trustedPKD": false
});
Logical sign of passive authentication performance:
DocumentReader.setRfidScenario({
"passiveAuth": true
});
Logical sign of the cancellation of active authentication procedure (AA) after the successful performance of chip authentication (CA) procedure:
DocumentReader.setRfidScenario({
"skipAA": false
});
Selection of the type of logical data profiler to use with the electronic document:
DocumentReader.setRfidScenario({
"profilerType": eRFID_SDK_ProfilerType.SPT_DOC_9303_EDITION_2006
});
Strict ISO protocol:
DocumentReader.setRfidScenario({
"strictProcessing": false
});
Allows to specify whether the ePassport has to be read or not:
DocumentReader.setRfidScenario({
"readEPassport": true
});
Allows to specify which data groups of the ePassport have to be read:
DocumentReader.setRfidScenario({
"ePassportDataGroups": {"DG1": true}
});
Allows to specify whether the eID has to be read or not:
DocumentReader.setRfidScenario({
"readEID": false
});
Allows to specify which data groups of the eID have to be read:
DocumentReader.setRfidScenario({
"eIDDataGroups": {"DG1": true}
});
Allows to specify whether the eDL has to be read or not:
DocumentReader.setRfidScenario({
"readEDL": true
});
Allows to specify which data groups of the eDL have to be read:
DocumentReader.setRfidScenario({
"eDLDataGroups": {"DG1": true}
});
Other
Logs
Allows you to get the path to the folder of the current session. Before using this, enable save logs. Each new session provides different path:
DocumentReader.getSessionLogFolder().then((str) {
print(str);
}).catchError(
(Object error) => print((error as PlatformException).message));
Camera Session
If set, camera session will be paused as soon as the result is received:
DocumentReader.setCameraSessionIsPaused(true).then((str) {
print(str);
}).catchError(
(Object error) => print((error as PlatformException).message));