Custom settings
This page covers the description of custom settings

Contents

Process Params

Document processing

Multipage processing

Allows to process more than one page of the document (if they are exist) for several iterations:
Java
Kotlin
1
DocumentReader.Instance().processParams().multipageProcessing = true;
Copied!
1
DocumentReader.Instance().processParams().multipageProcessing = true
Copied!
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):
This option is available for the following scenarios: DocType, Ocr, FullProcess, MrzOrBarcodeOrOcr, MrzOrOcr, LocateVisual_And_MrzOrOcr.
Java
Kotlin
1
DocumentReader.Instance().processParams().doublePageSpread = true;
Copied!
1
DocumentReader.Instance().processParams().doublePageSpread = true
Copied!

Authenticity

Allows you to define whether a document's holograms have to be checked:
Java
Kotlin
1
DocumentReader.Instance().processParams().checkHologram = true;
Copied!
1
DocumentReader.Instance().processParams().checkHologram = true
Copied!

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:
Java
Kotlin
1
DocumentReader.Instance().processParams().timeout = 20.0;
Copied!
1
DocumentReader.Instance().processParams().timeout = 20.0
Copied!
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:
Java
Kotlin
1
DocumentReader.Instance().processParams().timeoutFromFirstDetect = 5.0;
Copied!
1
DocumentReader.Instance().processParams().timeoutFromFirstDetect = 5.0
Copied!
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:
Java
Kotlin
1
DocumentReader.Instance().processParams().timeoutFromFirstDocType = 3.0;
Copied!
1
DocumentReader.Instance().processParams().timeoutFromFirstDocType = 3.0
Copied!

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":
Java
Kotlin
1
DocumentReader.Instance().processParams().dateFormat = "dd-mm-yyyy";
Copied!
1
DocumentReader.Instance().processParams().dateFormat = "dd-mm-yyyy"
Copied!
If you want to change the measure system, use one of the RGLMeasureSystem members:
Java
Kotlin
1
DocumentReader.Instance().processParams().measureSystem = RGLMeasureSystem.METRIC;
Copied!
1
DocumentReader.Instance().processParams().measureSystem = RGLMeasureSystem.METRIC
Copied!

Logs

If set, SDK logs will be written to the logcat:
Java
Kotlin
1
DocumentReader.Instance().processParams().setLogs(true);
Copied!
1
DocumentReader.Instance().processParams().setLogs(true)
Copied!
If set, logs will be saved (in case of reading problems). Turn on/off logs saving:
Java
Kotlin
1
DocumentReader.Instance().processParams().debugSaveLogs = true;
Copied!
1
DocumentReader.Instance().processParams().debugSaveLogs = true
Copied!
If set, input images will be saved (in case of reading problems). Turn on/off images saving:
Java
Kotlin
1
DocumentReader.Instance().processParams().debugSaveImages = true;
Copied!
1
DocumentReader.Instance().processParams().debugSaveImages = true
Copied!
If set, input images will be cropped and saved. Turn on/off image saving:
Java
Kotlin
1
DocumentReader.Instance().processParams().debugSaveCroppedImages = true;
Copied!
1
DocumentReader.Instance().processParams().debugSaveCroppedImages = true
Copied!
Allows to save RFID session data to the file in binary format:
Java
Kotlin
1
DocumentReader.Instance().processParams().debugSaveRFIDSession = true;
Copied!
1
DocumentReader.Instance().processParams().debugSaveRFIDSession = true
Copied!
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:
Java
Kotlin
1
DocumentReader.Instance().processParams().sessionLogFolder
Copied!
1
DocumentReader.Instance().processParams().sessionLogFolder
Copied!
If set, personal information will be removed from logs:
Java
Kotlin
1
DocumentReader.Instance().processParams().depersonalizeLog = true;
Copied!
1
DocumentReader.Instance().processParams().depersonalizeLog = true
Copied!

Scenario

Set proper scenario. You can find information of how to get available scenarios here:
Java
Kotlin
1
DocumentReader.Instance().processParams().scenario = Scenario.SCENARIO_BARCODE;
Copied!
1
DocumentReader.Instance().processParams().scenario = Scenario.SCENARIO_BARCODE
Copied!
You can assign a scenario to the Capture button. This scenario will be used if you press the button:
Java
Kotlin
1
DocumentReader.Instance().processParams().captureButtonScenario = Scenario.SCENARIO_LOCATE;
Copied!
1
DocumentReader.Instance().processParams().captureButtonScenario = Scenario.SCENARIO_LOCATE
Copied!

Barcode types

Set the types of barcodes that you wish to process:
Java
Kotlin
1
DocumentReader.Instance().processParams().doBarcodes = new String[]{BarcodeType.valueOf(BarcodeType.PDF417), BarcodeType.valueOf(BarcodeType.QRCODE)};
Copied!
1
DocumentReader.Instance().processParams().doBarcodes = arrayOf(BarcodeType.valueOf(BarcodeType.PDF417), BarcodeType.valueOf(BarcodeType.QRCODE))
Copied!
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:
Java
Kotlin
1
DocumentReader.Instance().processParams().barcodeParserType = 123;
Copied!
1
DocumentReader.Instance().processParams().barcodeParserType = 123
Copied!

Filters

Set the list of the document ID's to process. All documents will be processed, if empty:
Java
Kotlin
1
DocumentReader.Instance().processParams().documentIDList = new int[]{-274257313, -2004898043};
Copied!
1
DocumentReader.Instance().processParams().documentIDList = intArrayOf(-274257313, -2004898043)
Copied!
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:
Java
Kotlin
1
DocumentReader.Instance().processParams().fieldTypesFilter = new int[]{eVisualFieldType.FT_DATE_OF_EXPIRY};
Copied!
1
DocumentReader.Instance().processParams().fieldTypesFilter = intArrayOf(eVisualFieldType.FT_DATE_OF_EXPIRY)
Copied!
If set, in case required fields are not read, their values will be empty:
Java
Kotlin
1
DocumentReader.Instance().processParams().checkRequiredTextFields = true;
Copied!
1
DocumentReader.Instance().processParams().checkRequiredTextFields = true
Copied!

Detection

If you enable this parameter, document focus check will be omitted:
Java
Kotlin
1
DocumentReader.Instance().processParams().disableFocusingCheck = false;
Copied!
1
DocumentReader.Instance().processParams().disableFocusingCheck = false
Copied!
Allows you to set the maximum value of the deviation of the corners of the document from the value of 90 degrees:
Java
Kotlin
1
DocumentReader.Instance().processParams().perspectiveAngle = 5;
Copied!
1
DocumentReader.Instance().processParams().perspectiveAngle = 5
Copied!

Output images

If set, an original (uncropped) image will be received, which is sent to Core for processing:
Java
Kotlin
1
DocumentReader.Instance().processParams().returnUncroppedImage = true;
Copied!
1
DocumentReader.Instance().processParams().returnUncroppedImage = true
Copied!
Allows to build an integral image, taking into account the quality of fixation of each of the individual images:
Java
Kotlin
1
DocumentReader.Instance().processParams().integralImage = true;
Copied!
1
DocumentReader.Instance().processParams().integralImage = true
Copied!
Allows you to set the minimum acceptable DPI value:
Java
Kotlin
1
DocumentReader.Instance().processParams().minDPI = 100;
Copied!
1
DocumentReader.Instance().processParams().minDPI = 100
Copied!
If set, an image with cropped barcode will be returned:
Java
Kotlin
1
DocumentReader.Instance().processParams().returnCroppedBarcode = true;
Copied!
1
DocumentReader.Instance().processParams().returnCroppedBarcode = true
Copied!

Custom params

Allows you to set a custom JSON which should be processed along with other process params:
Java
Kotlin
1
// allows you to depersonalize the document's data
2
DocumentReader.Instance().processParams().customParams = new JSONObject("{\"dePersonalize\":[{\"allTextFields\":true},{\"allGraphicFields\":true}]}");
3
4
// allows you to set the maximum DPI for an output image (if set to zero, an image won't be resized):
5
DocumentReader.Instance().processParams().customParams = new JSONObject("{\"imageDpiOutMax\":0}");
Copied!
1
// allows you to depersonalize the document's data
2
DocumentReader.Instance().processParams().customParams = JSONObject("{\"dePersonalize\":[{\"allTextFields\":true},{\"allGraphicFields\":true}]}")
3
4
// allows you to set the maximum DPI for an output image (if set to zero, an image won't be resized):
5
DocumentReader.Instance().processParams().customParams = JSONObject("{\"imageDpiOutMax\":0}")
Copied!

Bounds

Allows you to manually set the document's bounds:
Java
Kotlin
1
DocumentReader.Instance().processParams().manualCrop = true;
Copied!
1
DocumentReader.Instance().processParams().manualCrop = true
Copied!

Other

Allows you to manually set the document's bounds:
Java
1
DocumentReader.Instance().processParams().resultTypeOutput = new int[]{eRPRM_ResultType.RPRM_RESULT_TYPE_MRZ_OCR_EXTENDED, eRPRM_ResultType.RPRM_RESULT_TYPE_VISUAL_OCR_EXTENDED};
Copied!
Returns 2 aligned and straighten passport pages from input image as if it was captured from the flatbed scanner:
Java
1
DocumentReader.Instance().processParams().generateDoublePageSpreadImage = true;
Copied!
Allows you to set the maximum DPI for an output image (if set to zero, an image won't be resized):
Java
1
DocumentReader.Instance().processParams().imageDpiOutMax = 300;
Copied!
This option can be set to true if you know for sure that the image you provide contains an already cropped document by its edges.
Java
1
DocumentReader.Instance().processParams().alreadyCropped = true;
Copied!
Allows to use specific template ID and skip document type identification step:
Java
1
DocumentReader.Instance().processParams().forceDocID = 123;
Copied!
Allows to ignore assumptions based on the field mask in the template:
Java
1
DocumentReader.Instance().processParams().matchTextFieldMask = true;
Copied!
When enabled, shorten the list of candidates to process during document detection in a single image process mode. Reduces processing time for specific backgrounds:
Java
1
DocumentReader.Instance().processParams().fastDocDetect = true;
Copied!
When enabled, OCR validity fails if there is a glare over the text field on the image:
Java
1
DocumentReader.Instance().processParams().updateOCRValidityByGlare = true;
Copied!
When enabled no graphic fields will be cropped from document image:
Java
1
DocumentReader.Instance().processParams().noGraphics = true;
Copied!
Specifies minimal area of the image that document should cover to be treated as candidate when locating. Value should be in range from 0 to 1, where 1 is when document should fully cover the image.
Java
1
DocumentReader.Instance().processParams().documentAreaMin = 0.7;
Copied!
Allows to shift the date of expiry into the future or past for number of months specified:
Java
1
DocumentReader.Instance().processParams().shiftExpiryDate = 1;
Copied!
This options allows specifying the minimal age in years of the document holder:
Java
1
DocumentReader.Instance().processParams().minimalHolderAge = 18;
Copied!
Guarantees that output image will contain correct MRZ on it in series process mode:
Java
1
DocumentReader.Instance().processParams().forceReadMrzBeforeLocate = true;
Copied!
Guarantees that output image will contain correct MRZ on it in series process mode:
Java
1
DocumentReader.Instance().processParams().mrzFormatsFilter = new String[]{MRZFormat.FORMAT_2X44, MRZFormat.FORMAT_3X30};
Copied!
If actual document dpi is below this threshold, check will fail:
Java
1
DocumentReader.Instance().processParams().imageQA.dpiThreshold = 150;
Copied!
If actual document perspective angle is above this threshold, check will fail:
Java
1
DocumentReader.Instance().processParams().imageQA.angleThreshold = 5;
Copied!
This option disabled focus check during performing image quality validation:
Java
1
DocumentReader.Instance().processParams().imageQA.focusCheck = true;
Copied!
This option disabled glares check during performing image quality validation:
Java
1
DocumentReader.Instance().processParams().imageQA.glaresCheck = true;
Copied!
This option disabled colorness check during performing image quality validation:
Java
1
DocumentReader.Instance().processParams().imageQA.colornessCheck = true;
Copied!
This option disabled moire patterns check during performing image quality validation:
Java
1
DocumentReader.Instance().processParams().imageQA.moireCheck = true;
Copied!

Functionality

Camera Frame

Set this setting to override default cropping frame on camera activity provided by scenario using one of DocReaderFrame members:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setCameraFrame(DocReaderFrame.MAX).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setCameraFrame(DocReaderFrame.MAX).apply()
Copied!
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:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowTorchButton(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowTorchButton(true).apply()
Copied!
Show/hide close button:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowCloseButton(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowCloseButton(true).apply()
Copied!
Capture allows to take picture and process as a single frame. Show/hide capture button:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowCaptureButton(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowCaptureButton(true).apply()
Copied!
You can set the time interval when Capture button should be displayed after the document is detected. 5 seconds is used by default:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowCaptureButtonDelayFromDetect(5).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowCaptureButtonDelayFromDetect(5).apply()
Copied!
To use this setting you should enable the setShowCaptureButton() 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:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowCaptureButtonDelayFromStart(10).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowCaptureButtonDelayFromStart(10).apply()
Copied!
To use this setting you should enable the setShowCaptureButton() parameter.
If set, frame expanding button will be shown on video capture screen. Show/hide change frame button:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowChangeFrameButton(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowChangeFrameButton(true).apply()
Copied!
Show/hide skip next page button:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowSkipNextPageButton(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowSkipNextPageButton(true).apply()
Copied!
Show/hide the button for switching between cameras during processing:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setShowCameraSwitchButton(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setShowCameraSwitchButton(true).apply()
Copied!
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:
Please use this setting at your own risk as the end app may crash.
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setIsCameraTorchCheckDisabled(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setIsCameraTorchCheckDisabled(true).apply()
Copied!

Detection

DocumentReader will receive data from Motion Sensor and pause scanning when device is moving. Turn on/off video capture motion control:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setVideoCaptureMotionControl(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setVideoCaptureMotionControl(true).apply()
Copied!
If set, scanning will be paused while camera is focusing (it can decrease camera processing speed):
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setSkipFocusingFrames(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setSkipFocusingFrames(true).apply()
Copied!

Orientation

Defines orientation of activities by using one of DocReaderOrientation members:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setOrientation(DocReaderOrientation.PORTRAIT).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setOrientation(DocReaderOrientation.PORTRAIT).apply()
Copied!

Scanning modes

Allows you to set the scanning mode:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setCaptureMode(CaptureMode.CAPTURE_VIDEO);
Copied!
1
DocumentReader.Instance().functionality().edit().setCaptureMode(CaptureMode.CAPTURE_VIDEO)
Copied!
If set, as soon as a document is detected during the scanning process, picture will be taken and processed as a single frame. It is used for devices with poor-quality video preview:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setPictureOnBoundsReady(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setPictureOnBoundsReady(true).apply()
Copied!
Allows you to control in the multipage processing mode:
Do not use multipageProcessing and this one at the same time.
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setManualMultipageMode(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setManualMultipageMode(true).apply()
Copied!

Video settings

Set the frame resolution, i.e. camera preview size:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setCameraSize(1920, 1080).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setCameraSize(1920, 1080).apply()
Copied!
Allows you to set a camera API:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setCameraMode(CameraMode.CAMERA2).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setCameraMode(CameraMode.CAMERA2).apply()
Copied!
Allows you to set a list of devices that must not use the camera2 API:
Java
Kotlin
1
List<String> models = Arrays.asList("Nexus 5X", "Pixel 4"); // Build.MODEL
2
DocumentReader.Instance().functionality().edit().setExcludedCamera2Models(models).apply();
Copied!
1
val models = Arrays.asList("Nexus 5X", "Pixel 4") // Build.MODEL
2
DocumentReader.Instance().functionality().edit().setExcludedCamera2Models(models).apply()
Copied!
If set, allows you to adjust a zoom level using the pinch gesture (its range from 1x to 10x):
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setZoomEnabled(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setZoomEnabled(true).apply()
Copied!
Allows you to set the desired zoom level (its range from 1x to 10x):
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setZoomFactor(2.0F).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setZoomFactor(2.0F).apply()
Copied!
Allows you to record the scanning process:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setDoRecordProcessingVideo(true).apply();
2
DocumentReader.Instance().setVideoEncoderCompletion(new IVideoEncoderCompletion() {
3
@Override
4
public void onVideoRecorded(String sessionId, File file) {
5
Log.d("MainActivity", "Session ID: " + sessionId);
6
Log.d("MainActivity", "Path: " + file.getPath());
7
}
8
});
Copied!
1
DocumentReader.Instance().functionality().edit().setDoRecordProcessingVideo(true).apply()
2
DocumentReader.Instance().setVideoEncoderCompletion { sessionId, file ->
3
Log.d("MainActivity", "Session ID: $sessionId")
4
Log.d("MainActivity", "Path: " + file.path)
5
}
Copied!

Extra info

If set, the metadata will be displayed over the camera preview during document processing, namely the perspective angle value:
Java
Kotlin
1
DocumentReader.Instance().functionality().edit().setDisplayMetadata(true).apply();
Copied!
1
DocumentReader.Instance().functionality().edit().setDisplayMetadata(true).apply()
Copied!

Customization

Camera Frame

Set thickness of document bounds border on the video preview (dp):
Java
Kotlin
1
DocumentReader.Instance().customization().edit().setCameraFrameBorderWidth(5).apply();
Copied!
1
DocumentReader.Instance().customization().edit().setCameraFrameBorderWidth(5).apply()
Copied!
Hex string of document bounds border color in default state:
Java
Kotlin
1
DocumentReader.Instance().customization().edit().setCameraFrameDefaultColor("#ff0000").apply();
Copied!
1
DocumentReader.Instance().customization().edit().setCameraFrameDefaultColor("#ff0000").apply()
Copied!
Hex string of document bounds border color in document detected state:
Java
Kotlin
1
DocumentReader.Instance().customization().edit().setCameraFrameActiveColor("#c300ff").apply();
Copied!
1
DocumentReader.Instance().customization().edit().setCameraFrameActiveColor("#c300ff").apply()
Copied!
Defines the shape of document bounds border. Use one of FrameShapeType members:
Java
Kotlin
1
DocumentReader.Instance().customization().edit().setCameraFrameShapeType(FrameShapeType.CORNER).apply();
Copied!
1
DocumentReader.Instance().customization().edit().setCameraFrameShapeType(FrameShapeType.CORNER).apply()
Copied!
Defines the length (dp) of the corner side in shape mode FrameShapeType.CORNER:
Java
Kotlin
1
DocumentReader.Instance().customization().edit().setCameraFrameLineLength(50).apply();
Copied!
1
DocumentReader.Instance().customization().edit().setCameraFrameLineLength(50).apply()
Copied!
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:
Java
Kotlin
1
DocumentReader.Instance().customization().edit().setCameraFrameCornerRadius(10.0F).apply();
Copied!
1
DocumentReader.Instance().customization().edit().setCameraFrameCornerRadius(10.0F).apply()
Copied!
Allows to customize the beginning and ending of stroked lines of the camera frame:
Java
Kotlin
1
DocumentReader.Instance().customization().edit().setCameraFrameLineCap(Paint.Cap.ROUND).apply();
Copied!
1
DocumentReader.Instance().customization().edit().setCameraFrameLineCap(Paint.Cap.ROUND).apply()
Copied!
Allows to specify the offsetWidth for the camera frame (only for the portrait orientation):