Custom settings

This page covers the description of custom settings

Contents

Process Params

Multipage Processing

Multipage processing allows to read more than one page. Turn on/off multipage:

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.

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 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

Scenario

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

DocumentReader.Instance().processParams().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 = "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)};

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

Detection

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

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

Uncropped Image

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

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

JSON

Allows to transfer custom JSON to Core, which should be processed:

DocumentReader.Instance().processParams().customParams = new JSONObject("{\"key\":\"value\"}");

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().setCameraFrame(DocReaderFrame.MAX);

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().setShowTorchButton(true);

Show/hide close button:

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

You can close camera view manually by using DocumentReader.Instance().stopScanner() function.

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

DocumentReader.Instance().functionality().setShowCaptureButton(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.Instance().functionality().setShowCaptureButtonDelayFromDetect(5);

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().setShowCaptureButtonDelayFromStart(10);

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().setShowChangeFrameButton(true);

Show/hide skip next page button:

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

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

DocumentReader.Instance().functionality().setShowCameraSwitchBtn(true);

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().setVideoCaptureMotionControl(true);

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

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

Orientation

Defines orientation of activities by using one of DocReaderOrientation members:

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

Single Frame Capturing

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.Instance().functionality().setPictureOnBoundsReady(true);

Customization

Camera Frame

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

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

Hex string of document bounds border color in default state:

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

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

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

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

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

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

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

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.

Status Message

Set a status message next to the frame:

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

Turn on/off status message:

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

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

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

Size of main text status (sp):

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

Hex string of main text status color:

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

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().setStatusPositionMultiplier(0.5D);

Result Status Message

Set a result status message next to the frame:

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

Turn on/off result status message:

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

Set the text font for the current status:

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

Set the size of current text status (sp):

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

Hex string of current text status color:

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

Hex string of current text status background color:

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

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().setResultStatusPositionMultiplier(0.5D);

Animation

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

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

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

DocumentReader.Instance().customization().setHelpAnimationImageID(R.drawable.icon);

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

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

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

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

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

DocumentReader.Instance().customization().setMultipageAnimationFrontImage(R.drawable.icon);

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

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

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

DocumentReader.Instance().customization().setMultipageAnimationBackImage(R.drawable.icon);

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

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

Visual Elements

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

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

Skip Button

Set the background color to the multipage button:

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

Loading Indicator

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

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

Background

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

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

Allows to change the intensity of the background mask:

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

Allows to set image within camera frame:

DocumentReader.Instance().customization().setBorderBackgroundImage(R.drawable.icon);

Version

To get the API version use:

DocumentReader.Instance().version.api

To get the Core version use:

DocumentReader.Instance().version.core

To get the Core mode use:

DocumentReader.Instance().version.coreMode

Allows you to get database id, e.g. KAZ:

DocumentReader.Instance().version.database.databaseID

To get the database version use:

DocumentReader.Instance().version.database.version

Allows you to get the database export date:

DocumentReader.Instance().version.database.date

To get the list of supported database documents use:

DocumentReader.Instance().version.database.databaseDescription

Allows to get the number of supported database countries:

DocumentReader.Instance().version.database.countriesNumber

Allows to get the number of supported database documents:

DocumentReader.Instance().version.database.documentsNumber

License

Allows to get an expiration date of the license:

DocumentReader.Instance().licenseResult().license().getExpiryDate()

Allows to get a list of country identifiers which are defined for processing in the license. If the array is empty, there are no restrictions for processing:

DocumentReader.Instance().licenseResult().license().getCountryFilter()

RFID-chip

RFID-chip reading parameters:

DocumentReader.Instance().rfidScenario()

Last updated