Class DocumentScannerViewConfiguration

Hierarchy

  • ScannerConfiguration
    • DocumentScannerViewConfiguration

Constructors

Properties

autoCaptureDelay?: number

Delay in milliseconds before the auto-capture is triggered after 'onDocumentDetected' has been called. This delay is used to prevent too many documents being captured in a row. In essence, autoCaptureSensitivity controls the speed of autocapture during the detection phase, while autoCaptureDelay controls the speed of autocapture after the detection phase. Default is 1000ms.

autoCaptureEnabled?: boolean

If auto-capture is enabled and when a document is detected, it will be automatically captured when conditions are good and the auto-snapping time-out elapses.

autoCaptureSensitivity?: number

Controls the auto-capture speed. Sensitivity must be within the 0..1 range. A value of 1.0 triggers automatic capturing immediately, a value of 0.0 delays the automatic by 3 seconds. The default value is 0.66 (2 seconds)

backgroundColor?: string
container?: HTMLElement

The container HTML element of Scanbot Web SDK camera. Required when 'containerId' property is left undefined when calling any ScanbotSDK createScanner function. If both are provided, 'container' property takes precedence.

containerId?: string

The container HTML element id of Scanbot Web SDK camera. Required when 'container' property is left undefined when calling any ScanbotSDK createScanner function If both are provided, 'container' property takes precedence.

detectionParameters?: DeepPartial<DocumentScannerParameters>
finder?: {
    aspectRatio?: { readonly width?: number; readonly height?: number; _marker?: () => void; };
    overlayColor?: string;
    style?: ({ readonly _type?: "FinderCorneredStyle"; strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) | ({ readonly _type?: "FinderStrokedStyle"; strokeColor?: string; strokeWidth?: number; cornerRadius?: number; });
    visible?: boolean;
}

Type declaration

  • Optional aspectRatio?: { readonly width?: number; readonly height?: number; _marker?: () => void; }

    The viewfinder's aspect ratio.

    Default Value

    new AspectRatio({
    "width": 1.0,
    "height": 1.0
    });
  • Optional overlayColor?: string

    Color of the viewfinder overlay.

    Default Value

    "?sbColorSurfaceLow";
    
  • Optional style?: ({ readonly _type?: "FinderCorneredStyle"; strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) | ({ readonly _type?: "FinderStrokedStyle"; strokeColor?: string; strokeWidth?: number; cornerRadius?: number; })

    Visual appearance of the viewfinder.

    Default Value

    new FinderCorneredStyle({
    "strokeColor": "?sbColorSurface",
    "strokeWidth": 2.0,
    "cornerRadius": 10.0
    });
  • Optional visible?: boolean

    Whether the viewfinder is visible.

    Default Value

    true;
    
ignoreBadAspectRatio?: boolean

Determines whether to ignore the OK_BUT_BAD_ASPECT_RATIO detection status. By default BadAspectRatio is not ignored.

mirrored?: boolean
onCaptureButtonClick?: ((e) => void)

Type declaration

    • (e): void
    • By default, capture button invokes 'onDocumentDetected' callback, if you want custom behavior, you can optionally override this button

      Parameters

      • e: any

      Returns void

onDocumentDetected?: ((result) => void)

Type declaration

    • (result): void
    • Document detected callback. Continuous callback, stopped only when detection is stopped or camera widget is disposed.

      Parameters

      Returns void

onError?: ((e) => void)

Type declaration

    • (e): void
    • Error callback of the SDK. If any error was reported, your scanner might not be scanning anymore, e.g. due to an out-of-memory error. You should dispose the scanner and use ScanbotSDK.destroy and ScanbotSDK.initialize to re-initialize the SDK.

      Parameters

      • e: any

      Returns void

preferredCamera?: string

Camera id or camera label. A list of available cameras can be obtained from ScanbotSDK.cameras.

spinnerColor?: string
useImageCaptureAPI?: boolean

Attempts to take a single exposure using the video capture device, resulting in a high resolution image and potentially greatly improved detection quality. Relies on the experimental ImageCapture API that: https://developer.mozilla.org/en-US/docs/Web/API/ImageCapture. Use with caution. At the time of writing this, reliably only works on Android devices with Google Chrome. If enabled, this only affects extraction after the document outline has been identified. This may also trigger your device's default "snap" animation, making scanbotSDK.utils.flash(); irrelevant Defaults to false.

videoConstraints?: any

ScanbotCameraView video constraints

DEFAULT_ACCEPTED_ANGLE_SCORE: number
DEFAULT_ACCEPTED_BRIGHTNESS_SCORE: number
DEFAULT_ACCEPTED_SIZE_SCORE: number
DEFAULT_VIDEO_RESOLUTION_4K: {
    height: number;
    width: number;
}

Type declaration

  • height: number
  • width: number
DEFAULT_VIDEO_RESOLUTION_HD: {
    height: number;
    width: number;
}

Type declaration

  • height: number
  • width: number

Methods

  • Parameters

    • source: any
    • destination: {
          [key: string]: any;
      }
      • [key: string]: any
    • Optional ignore: string[]

    Returns void

  • Parameters

    • source: any
    • destination: {
          [key: string]: any;
      }
      • [key: string]: any

    Returns void

Generated using TypeDoc