Class TextDataScannerConfiguration

Hierarchy

Constructors

Properties

allowedCharacters?: string
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.

finder?: {
    aspectRatio?: { width?: number; height?: number; };
    overlayColor?: string;
    style?: ({ _type?: "FinderCorneredStyle"; strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) | ({ _type?: "FinderStrokedStyle"; strokeColor?: string; strokeWidth?: number; cornerRadius?: number; });
    visible?: boolean;
}

Type declaration

  • Optional aspectRatio?: { width?: number; height?: number; }

    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?: ({ _type?: "FinderCorneredStyle"; strokeColor?: string; strokeWidth?: number; cornerRadius?: number; }) | ({ _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;
    
matchSubstring?: boolean

Controls if validationPattern should match the entire scanned text, or if it should find a matching substring.

mirrored?: boolean
ocrResolutionLimit?: number
onError?: ((e) => void)

Type declaration

    • (e): void
    • Error callback of the SDK.

      Parameters

      • e: any

      Returns void

onTextDetected?: TextDetectionCallback
preferredCamera?: string
spinnerColor?: string
supportedLanguages?: string[]
userGuidance?: {
    background?: { strokeColor?: string; fillColor?: string; strokeWidth?: number; };
    title?: { visible?: boolean; text?: string; color?: string; useShadow?: boolean; };
    visible?: boolean;
}

Type declaration

  • Optional background?: { strokeColor?: string; fillColor?: string; strokeWidth?: number; }

    Background style used for the user guidance.

    Default Value

    new BackgroundStyle({
    "strokeColor": "#00000000",
    "fillColor": "?sbColorSurfaceLow"
    });
  • Optional title?: { visible?: boolean; text?: string; color?: string; useShadow?: boolean; }

    Title of the user guidance.

    Default Value

    new StyledText({
    "color": "?sbColorOnPrimary"
    });
  • Optional visible?: boolean

    Whether the user guidance is visible.

    Default Value

    true;
    
validationPattern?: string

Simple validation string pattern

  • ? = any character
  • # = any digit
  • all other characters represent themselves

If matchSubstring is true, the scanned text will be truncated to a substring matching the pattern. If matchSubstring is false, the scanned text will not be truncated. However, the results validated flag will only be set, if the entire scanned text matches the pattern.

If validationPattern is empty, any scanned text will be accepted.

validationPattern & validatorPreset cannot be used together.

validatorPreset?: "VehicleIdentificationNumber"
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

Generated using TypeDoc