Skip to content

Document Processing Settings

Processing Modes

  • Set the scanning mode:
DocumentReader.setConfig({
  "functionality": {"captureMode": CaptureMode.CAPTURE_VIDEO}
});
  • Set the frame resolution, i.e. camera preview size:
DocumentReader.setConfig({
  "functionality": {
    "cameraSize": { "width": 1920, "height": 1080 }, // Android
    "videoSessionPreset": AVCaptureSessionPreset.Hd1920x1080 // iOS
  }
});
  • Adjust a zoom level using the pinch gesture (in a range from 1x to 10x):
DocumentReader.setConfig({
  "functionality": {"isZoomEnabled": true}
});
  • Set the zoom level (in a range from 1x to 10x):
DocumentReader.setConfig({
  "functionality": {"zoomFactor": 2.0}
});
  • Control in the multipage processing mode:
DocumentReader.setConfig({
  "functionality": {"manualMultipageMode": true}
});

Warning

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

  • Define the orientation of activities:

Danger

Make sure that the selected orientation corresponds to your application’s orientation. Otherwise, it may lead to unexpected behavior.

DocumentReader.setConfig({
  "functionality": {
    "orientation": Platform.isIOS
        ? UIInterfaceOrientationMask.Portrait
        : DocReaderOrientation.PORTRAIT
  }
});
  • Specify the position of a capture device for video sessions:
DocumentReader.setConfig({
  "functionality": {"cameraPosition": AVCaptureDevicePosition.Front}
});

Record Processing

To record the scanning process, use:

DocumentReader.setConfig({
  "functionality": {"recordScanningProcess": true}
});

Frame Processing

  • You can assing a scenario that will be used upon tapping the Capture button:
DocumentReader.setConfig({
  "processParams": {"captureButtonScenario": ScenarioIdentifier.SCENARIO_LOCATE}
});
  • To manually set the document's bounds, invoke:
DocumentReader.setConfig({
  "processParams": {"manualCrop": true}
});
  • Set the following option to true if you know for sure that the image you provide contains an already cropped by edges document:
DocumentReader.setConfig({
  "processParams": {"alreadyCropped": true}
});

Barcode Recognition

There are documents that contain barcodes with data that can be parsed only if the document type verification is performed.

Use the following property to set up the barcode parser type which should be used during the recognition. In this case, the barcode data will be parced without performing the document type verification:

DocumentReader.setConfig({
  "processParams": {"barcodeParserType": 123}
});

Metadata

Display the metadata over the camera preview during the document processing, namely the perspective angle value:

DocumentReader.setConfig({
  "functionality": {"displayMetadata": true}
});

Custom Params

Set a custom JSON that should be processed along with other process params:

DocumentReader.setConfig({
  "processParams": {
    "customParams": {
      "dePersonalize": [
        {"allTextFields": true},
        {"allGraphicFields": true}
      ]
    }
  }
});