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:

DocumentReader.Instance().processParams().multipageProcessing = true;

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.

DocumentReader.Instance().processParams().doublePageSpread = true;

Authenticity

Allows you to define whether a document's holograms have to be checked:

DocumentReader.Instance().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.Instance().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.Instance().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.Instance().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.Instance().processParams().dateFormat = "dd-mm-yyyy";

If you want to change the measure system, use one of the RGLMeasureSystem members:

DocumentReader.Instance().processParams().measureSystem = RGLMeasureSystem.METRIC;

Logs

If set, SDK logs will be written to the logcat:

DocumentReader.Instance().processParams().setLogs(true);

If set, logs will be saved (in case of reading problems). Turn on/off logs saving:

DocumentReader.Instance().processParams().debugSaveLogs = true;

If set, input images will be saved (in case of reading problems). Turn on/off images saving:

DocumentReader.Instance().processParams().debugSaveImages = true;

If set, input images will be cropped and saved. Turn on/off image saving:

DocumentReader.Instance().processParams().debugSaveCroppedImages = true;

Allows to save RFID session data to the file in binary format:

DocumentReader.Instance().processParams().debugSaveRFIDSession = true;

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.Instance().processParams().sessionLogFolder

If set, personal information will be removed from logs:

DocumentReader.Instance().processParams().depersonalizeLog = true;

Scenario

Set proper scenario. You can find information of how to get available scenarios here:

DocumentReader.Instance().processParams().scenario = Scenario.SCENARIO_BARCODE;

You can assign a scenario to the Capture button. This scenario will be used if you press the button:

DocumentReader.Instance().processParams().captureButtonScenario = Scenario.SCENARIO_LOCATE;

Barcode types

Set the types of barcodes that you wish to process:

DocumentReader.Instance().processParams().doBarcodes = new String[]{BarcodeType.valueOf(BarcodeType.PDF417), BarcodeType.valueOf(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.Instance().processParams().barcodeParserType = 123;

Filters

Set the list of the document ID's to process. All documents will be processed, if empty:

DocumentReader.Instance().processParams().documentIDList = new int[]{-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.Instance().processParams().fieldTypesFilter = new int[]{eVisualFieldType.FT_DATE_OF_EXPIRY};

If set, in case required fields are not read, their values will be empty:

DocumentReader.Instance().processParams().checkRequiredTextFields = true;

Detection

If you enable this parameter, document focus check will be omitted:

DocumentReader.Instance().processParams().disableFocusingCheck = false;

Allows you to set the maximum value of the deviation of the corners of the document from the value of 90 degrees:

DocumentReader.Instance().processParams().perspectiveAngle = 5;

Output images

If set, an original (uncropped) image will be received, which is sent to Core for processing:

DocumentReader.Instance().processParams().returnUncroppedImage = true;

Allows to build an integral image, taking into account the quality of fixation of each of the individual images:

DocumentReader.Instance().processParams().integralImage = true;

Allows you to set the minimum acceptable DPI value:

DocumentReader.Instance().processParams().minDPI = 100;

If set, an image with cropped barcode will be returned:

DocumentReader.Instance().processParams().returnCroppedBarcode = true;

Custom params

Allows you to set a custom JSON which should be processed along with other process params:

// allows you to depersonalize the document's data
DocumentReader.Instance().processParams().customParams = new JSONObject("{\"dePersonalize\":[{\"allTextFields\":true},{\"allGraphicFields\":true}]}");

// allows you to set the maximum DPI for an output image (if set to zero, an image won't be resized):
DocumentReader.Instance().processParams().customParams = new JSONObject("{\"imageDpiOutMax\":0}");

Bounds

Allows you to manually set the document's bounds:

DocumentReader.Instance().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.Instance().functionality().edit().setCameraFrame(DocReaderFrame.MAX).apply();

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.Instance().functionality().edit().setShowTorchButton(true).apply();

Show/hide close button:

DocumentReader.Instance().functionality().edit().setShowCloseButton(true).apply();

Capture allows to take picture and process as a single frame. Show/hide capture button:

DocumentReader.Instance().functionality().edit().setShowCaptureButton(true).apply();

You can set the time interval when Capture button should be displayed after the document is detected. 5 seconds is used by default:

DocumentReader.Instance().functionality().edit().setShowCaptureButtonDelayFromDetect(5).apply();

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:

DocumentReader.Instance().functionality().edit().setShowCaptureButtonDelayFromStart(10).apply();

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:

DocumentReader.Instance().functionality().edit().setShowChangeFrameButton(true).apply();

Show/hide skip next page button:

DocumentReader.Instance().functionality().edit().setShowSkipNextPageButton(true).apply();

Show/hide the button for switching between cameras during processing:

DocumentReader.Instance().functionality().edit().setShowCameraSwitchButton(true).apply();

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.

DocumentReader.Instance().functionality().edit().setIsCameraTorchCheckDisabled(true).apply();

Detection

DocumentReader will receive data from Motion Sensor and pause scanning when device is moving. Turn on/off video capture motion control:

DocumentReader.Instance().functionality().edit().setVideoCaptureMotionControl(true).apply();

If set, scanning will be paused while camera is focusing (it can decrease camera processing speed):

DocumentReader.Instance().functionality().edit().setSkipFocusingFrames(true).apply();

Orientation

Defines orientation of activities by using one of DocReaderOrientation members:

DocumentReader.Instance().functionality().edit().setOrientation(DocReaderOrientation.PORTRAIT).apply();

Scanning modes

Allows you to set the scanning mode:

DocumentReader.Instance().functionality().edit().setCaptureMode(CaptureMode.CAPTURE_VIDEO);

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:

DocumentReader.Instance().functionality().edit().setPictureOnBoundsReady(true).apply();

Allows you to control in the multipage processing mode:

Do not use multipageProcessing and this one at the same time.

DocumentReader.Instance().functionality().edit().setManualMultipageMode(true).apply();

Video settings

Set the frame resolution, i.e. camera preview size:

DocumentReader.Instance().functionality().edit().setCameraSize(1920, 1080).apply();

Allows you to set a camera API:

DocumentReader.Instance().functionality().edit().setCameraMode(CameraMode.CAMERA2).apply();

Allows you to set a list of devices that must not use the camera2 API:

List<String> models = Arrays.asList("Nexus 5X", "Pixel 4"); // Build.MODEL
DocumentReader.Instance().functionality().edit().setExcludedCamera2Models(models).apply();

If set, allows you to adjust a zoom level using the pinch gesture (its range from 1x to 10x):

DocumentReader.Instance().functionality().edit().setZoomEnabled(true).apply();

Allows you to set the desired zoom level (its range from 1x to 10x):

DocumentReader.Instance().functionality().edit().setZoomFactor(2.0F).apply();

Allows you to record the scanning process:

DocumentReader.Instance().functionality().edit().setDoRecordProcessingVideo(true).apply();
DocumentReader.Instance().setVideoEncoderCompletion(new IVideoEncoderCompletion() {
    @Override
    public void onVideoRecorded(String sessionId, File file) {
        Log.d("MainActivity", "Session ID: " + sessionId);
        Log.d("MainActivity", "Path: " + file.getPath());
    }
});

Extra info

If set, the metadata will be displayed over the camera preview during document processing, namely the perspective angle value:

DocumentReader.Instance().functionality().edit().setDisplayMetadata(true).apply();

Customization

Camera Frame

Set thickness of document bounds border on the video preview (dp):

DocumentReader.Instance().customization().edit().setCameraFrameBorderWidth(5).apply();

Hex string of document bounds border color in default state:

DocumentReader.Instance().customization().edit().setCameraFrameDefaultColor("#ff0000").apply();

Hex string of document bounds border color in document detected state:

DocumentReader.Instance().customization().edit().setCameraFrameActiveColor("#c300ff").apply();

Defines the shape of document bounds border. Use one of FrameShapeType members:

DocumentReader.Instance().customization().edit().setCameraFrameShapeType(FrameShapeType.CORNER).apply();

Defines the length (dp) of the corner side in shape mode FrameShapeType.CORNER:

DocumentReader.Instance().customization().edit().setCameraFrameLineLength(50).apply();

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:

DocumentReader.Instance().customization().edit().setCameraFrameCornerRadius(10.0F).apply();

Allows to customize the beginning and ending of stroked lines of the camera frame:

DocumentReader.Instance().customization().edit().setCameraFrameLineCap(Paint.Cap.ROUND).apply();

Allows to specify the offsetWidth for the camera frame (only for the portrait orientation):

DocumentReader.Instance().customization().edit().setCameraFrameOffsetWidth(50).apply();

Allows to change the aspect ratio of the camera frame for portrait mode:

DocumentReader.Instance().customization().edit().setCameraFramePortraitAspectRatio(1.0F).apply();

Allows to change the aspect ratio of the camera frame for landscape mode:

DocumentReader.Instance().customization().edit().setCameraFrameLandscapeAspectRatio(1.0F).apply();

Allows to change the position of the camera frame vertically:

DocumentReader.Instance().customization().edit().setCameraFrameVerticalPositionMultiplier(0.5F).apply();

Buttons

Allows to change the Torch button's icon for both ON and OFF states:

// For the ON state
DocumentReader.Instance().customization().edit().setTorchImageOn(getResources().getDrawable(R.drawable.icon)).apply();

// For the OFF state
DocumentReader.Instance().customization().edit().setTorchImageOff(getResources().getDrawable(R.drawable.icon)).apply();

Allows to change the Close button's icon:

DocumentReader.Instance().customization().edit().setCloseButtonImage(getResources().getDrawable(R.drawable.icon)).apply();

Allows to change the Capture button's icon:

DocumentReader.Instance().customization().edit().setCaptureButtonImage(getResources().getDrawable(R.drawable.icon)).apply();

Allows to change the Change Frame button's icon for both ON and OFF states:

// For the ON state
DocumentReader.Instance().customization().edit().setChangeFrameExpandButtonImage(getResources().getDrawable(R.drawable.icon)).apply();

// For the OFF state
DocumentReader.Instance().customization().edit().setChangeFrameCollapseButtonImage(getResources().getDrawable(R.drawable.icon)).apply();

Allows to change the Camera Switch button's icon:

DocumentReader.Instance().customization().edit().setCameraSwitchButtonImage(getResources().getDrawable(R.drawable.icon)).apply();

Allows you to change the size of the toolbar (the area where the buttons are located):

DocumentReader.Instance().customization().edit().setToolbarSize(46.0F).apply();

Status Message

Set a status message next to the frame:

DocumentReader.Instance().customization().edit().setStatus("Hello").apply();

Turn on/off status message:

DocumentReader.Instance().customization().edit().setShowStatusMessages(true).apply();

Set the text font for the status message, so-called hint message:

DocumentReader.Instance().customization().edit().setStatusTextFont(Typeface.SERIF).apply();

Size of main text status (sp):

DocumentReader.Instance().customization().edit().setStatusTextSize(14).apply();

Hex string of main text status color:

DocumentReader.Instance().customization().edit().setStatusTextColor("#ff0000").apply();

Hex string of current text status background color:

DocumentReader.Instance().customization().edit().setStatusBackgroundColor("#32a852").apply();

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.Instance().customization().edit().setStatusPositionMultiplier(0.5F).apply();

Result Status Message

Set a result status message next to the frame:

DocumentReader.Instance().customization().edit().setResultStatus("Hello").apply();

Turn on/off result status message:

DocumentReader.Instance().customization().edit().setShowResultStatusMessages(true).apply();

Set the text font for the current status:

DocumentReader.Instance().customization().edit().setResultStatusTextFont(Typeface.SERIF).apply();

Set the size of current text status (sp):

DocumentReader.Instance().customization().edit().setResultStatusTextSize(14).apply();

Hex string of current text status color:

DocumentReader.Instance().customization().edit().setResultStatusTextColor("#ff0000").apply();

Hex string of current text status background color:

DocumentReader.Instance().customization().edit().setResultStatusBackgroundColor("#ff0000").apply();

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.Instance().customization().edit().setResultStatusPositionMultiplier(0.5F).apply();

Custom Status Message

Allows to create a custom status as SpannableString:

SpannableString str = new SpannableString("Hello, world!");
str.setSpan(new ForegroundColorSpan(Color.RED), 0, str.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
DocumentReader.Instance().customization().edit().setCustomLabelStatus(str).apply();

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.Instance().customization().edit().setCustomStatusPositionMultiplier(1.0F).apply();

Animation

If set, animation showing how to position document will be displayed. Show/hide help animation:

DocumentReader.Instance().customization().edit().setShowHelpAnimation(true).apply();

You can set image for the help animation. If not set, default image will be used:

DocumentReader.Instance().customization().edit().setHelpAnimationImage(getResources().getDrawable(R.drawable.icon)).apply();

Allows to change the scaling of the help animation image, use one of ImageView.ScaleType members:

DocumentReader.Instance().customization().edit().setHelpAnimationImageScaleType(ImageView.ScaleType.MATRIX).apply();
Matrix matrix = new Matrix();
DocumentReader.Instance().customization().edit().setHelpAnimationImageMatrix(matrix).apply();

If set, expecting page turn animation will be shown. Turn on/off next page animation:

DocumentReader.Instance().customization().edit().setShowNextPageAnimation(true).apply();

You can set front image for the multipage animation. If not set, default image will be used:

DocumentReader.Instance().customization().edit().setMultipageAnimationFrontImage(getResources().getDrawable(R.drawable.icon)).apply();

Allows to change the scaling of front image of the multipage animation, use one of ImageView.ScaleType members:

DocumentReader.Instance().customization().edit().setMultipageAnimationFrontImageScaleType(ImageView.ScaleType.MATRIX).apply();
Matrix matrix = new Matrix();
DocumentReader.Instance().customization().edit().setMultipageAnimationFrontImageMatrix(matrix).apply();

You can set back image for the multipage animation. If not set, default image will be used:

DocumentReader.Instance().customization().edit().setMultipageAnimationBackImage(getResources().getDrawable(R.drawable.icon)).apply();

Allows to change the scaling of back image of the multipage animation, use one of ImageView.ScaleType members:

DocumentReader.Instance().customization().edit().setMultipageAnimationBackImageScaleType(ImageView.ScaleType.MATRIX).apply();
Matrix matrix = new Matrix();
DocumentReader.Instance().customization().edit().setMultipageAnimationBackImageMatrix(matrix).apply();

Visual Elements

Hex string of visual elements color (one for all):

DocumentReader.Instance().customization().edit().setTintColor("#ff0000").apply();

Skip Button

Set the background color to the multipage button:

DocumentReader.Instance().customization().edit().setMultipageButtonBackgroundColor("#ff0000").apply();

Loading Indicator

Hex string of loading indicator(s) color. You can see it if you press the capture button:

DocumentReader.Instance().customization().edit().setActivityIndicatorColor("#ff0000").apply();

Background

If set, background will be darkened around the document detection frame. Show/hide background mask:

DocumentReader.Instance().customization().edit().setShowBackgroundMask(true).apply();

Allows to change the intensity of the background mask:

DocumentReader.Instance().customization().edit().setBackgroundMaskAlpha(0.5F).apply();

Allows to set image within camera frame:

DocumentReader.Instance().customization().edit().setBorderBackgroundImage(getResources().getDrawable(R.drawable.icon)).apply();

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.Instance().rfidScenario().setAutoSettings(true);

Allows to set an authentication procedure type, conducting which is expected in the presence of all the objective conditions:

DocumentReader.Instance().rfidScenario().setAuthProcType(eRFID_AuthenticationProcedureType.aptAdvanced);

Allows to set a type of priority mechanism for organizing SM-channel (Security Messaging - a mechanism of protected data exchanging):

DocumentReader.Instance().rfidScenario().setBaseSMProcedure(eRFID_AccessControl_ProcedureType.ACPT_BAC);

Allows to set a data access type for PACE procedure:

DocumentReader.Instance().rfidScenario().setPacePasswordType(eRFID_Password_Type.PPT_MRZ);

Priority of using DS-certificates:

DocumentReader.Instance().rfidScenario().setPkdDSCertPriority(false);

Use of CSCA-certificates submitted by individual data files only:

DocumentReader.Instance().rfidScenario().setPkdUseExternalCSCA(false);

Level of trust to CSCA-certificates from PKD:

DocumentReader.Instance().rfidScenario().setTrustedPKD(false);

Logical sign of passive authentication performance:

DocumentReader.Instance().rfidScenario().setPassiveAuth(true);

Logical sign of the cancellation of active authentication procedure (AA) after the successful performance of chip authentication (CA) procedure:

DocumentReader.Instance().rfidScenario().setSkipAA(false);

Selection of the type of logical data profiler to use with the electronic document:

DocumentReader.Instance().rfidScenario().setProfilerType(eRFID_SDK_ProfilerType.SPT_DOC_9303_EDITION_2006);

Strict ISO protocol:

DocumentReader.Instance().rfidScenario().setStrictProcessing(false);

Allows to specify whether the ePassport has to be read or not:

DocumentReader.Instance().rfidScenario().setReadEPassport(true);

Allows to specify which data groups of the ePassport have to be read:

DocumentReader.Instance().rfidScenario().ePassportDataGroups().setDG1(true);

Allows to specify whether the eID has to be read or not:

DocumentReader.Instance().rfidScenario().setReadEID(false);

Allows to specify which data groups of the eID have to be read:

DocumentReader.Instance().rfidScenario().eIDDataGroups().setDG1(true);

Allows to specify whether the eDL has to be read or not:

DocumentReader.Instance().rfidScenario().setReadEDL(true);

Allows to specify which data groups of the eDL have to be read:

DocumentReader.Instance().rfidScenario().eDLDataGroups().setDG1(true);

Last updated