Check Scanner UI | Cordova Document Scanner
The Scanbot SDK provides the ability to detect various types of checks in an image, crop them and recognize data fields via the Check Scanner.
Currently, the Check Scanner supports the following types of checks:
- USACheck - a check compatible with the ASC X9 standard used in the USA
- FRACheck - a check format commonly used in France
- KWTCheck - a check format commonly used in Kuwait
- AUSCheck - a check compatible with the Australian Paper Clearing System check standard
- INDCheck - a check compatible with the CTS-2010 standard issued by the Reserve Bank of India in 2012
- ISRCheck - a check format commonly used in Israel
Integrating the Check Scanner UI
import ScanbotSdk, { CheckRecognizerConfiguration } from 'cordova-plugin-scanbot-sdk';
private SDK = ScanbotSdk.promisify();
// Always make sure you have a valid license on runtime via SDK.getLicenseInfo()
if (!licenseCheckMethod()) { return; }
const configs: CheckRecognizerConfiguration = {
// Customize colors, text resources, behavior, etc..
enableCameraButtonTitle: 'Enable Camera',
orientationLockMode: 'PORTRAIT',
finderLineColor: '#0000ff',
// see further configs ...
};
const result = await this.SDK.UI.startCheckRecognizer({uiConfigs: configs});
if (result.status === 'CANCELED') {
// user has canceled the scanning operation
return;
}
// handle the extracted data
// result.fields.accountNumber
// result.fields.chequeNumber
// ...
Handling the Result
export interface CheckRecognizerResult {
/** Check Document */
check: USACheckDocument| FRACheckDocument | KWTCheckDocument | AUSCheckDocument | INDCheckDocument | ISRCheckDocument |UnknownCheckDocument;
/** The status of the operation */
checkStatus: CheckStatus;
/** The URI of the snapped Check Image */
imageFileUri?: string;
/** The type of the recognized check */
checkType: CheckStandard;
}
CheckDocument
is the base interface from which check documents extend:
export interface CheckDocument extends GenericDocumentWrapper {
/** Detected raw string */
rawString: Field;
/** type of check font */
fontType?: Field;
}
USACheckDocument
contains the following properties:
export interface USACheckDocument extends CheckDocument {
/** Auxiliary On-Us */
auxiliaryOnUs?: Field;
/** Transit number */
transitNumber: Field;
/** Account number */
accountNumber: Field;
}
FRACheckDocument
contains the following properties:
export interface FRACheckDocument extends CheckDocument {
/** Cheque number */
chequeNumber: Field;
/** Routing number */
routingNumber: Field;
/** Account number */
accountNumber: Field;
}
KWTCheckDocument
contains the following properties:
export interface KWTCheckDocument extends CheckDocument {
/** Cheque number */
chequeNumber: Field;
/** Sort code */
sortCode: Field;
/** Account number */
accountNumber: Field;
}
AUSCheckDocument
contains the following properties:
export interface AUSCheckDocument extends CheckDocument {
/** Extra auxiliary domestic */
extraAuxDomestic?: Field;
/** Auxiliary domestic */
auxDomestic?: Field;
/** BSB */
bsb: Field;
/** Account number */
accountNumber: Field;
/** Transaction code */
transactionCode: Field;
}
INDCheckDocument
contains the following properties:
export interface INDCheckDocument extends CheckDocument {
/** Serial number */
serialNumber: Field;
/** Sort number */
sortNumber?: Field;
/** Account number */
accountNumber: Field;
/** Transaction code */
transactionCode: Field;
}
ISRCheckDocument
contains the following properties:
export interface ISRCheckDocument extends CheckDocument {
/** Cheque number */
chequeNumber: Field;
/** Bank number */
bankNumber: Field;
/** Branch number */
branchNumber: Field;
/** Account number */
accountNumber: Field;
}
UnknownCheckResult
only extends CheckDocument:
export interface UnknownCheckDocument extends CheckDocument {
}
Customization
The UI and the behavior of the Check Scanner can be customized by passing the configs value
via CheckRecognizerConfiguration
. All configuration options are optional.
export interface CheckRecognizerConfiguration {
/** Accepted check standards. Optional, by default - all checks are accepted. With an empty list no filter is applied and all checks are accepted. */
acceptedCheckStandards?: CheckStandard[];
/** The preferred camera module (default - BACK) */
cameraModule?: CameraModule;
/** Background color outside of the finder window. */
cameraOverlayColor?: string;
/** Title of the cancel button. */
cancelButtonTitle?: string;
/** Whether the cancel button is hidden or not. iOS only. */
cancelButtonHidden?: boolean;
/** Set high-resolution Check image capturing. If set to TRUE a high-resolution photo of the check is captured to run the recognition on. Upon successful recognition the recognition result also contains a high-resolution image of the check. If set to FALSE, the video frames will be used for recognition and result image delivery. The default value is TRUE. */
captureHighResolutionImage?: boolean;
/** Title of the button that opens the screen where the user can allow the usage of the camera by the app. */
enableCameraButtonTitle?: string;
/** Text that will be displayed when the app is not allowed to use the camera, prompting the user to enable the usage of the camera. */
enableCameraExplanationText?: string;
/** The style of the dialog/alert in case of error. iOS Only. */
errorDialogStyle?: DialogStyle;
/** The style of the dialogs/alerts OK button in case of error. iOS Only. */
errorDialogButtonStyle?: DialogButtonStyle;
/** String being displayed as the title in the error alert that may occur when the recognition fails on captured high-resolution images. iOS only. */
errorAlertTitle?: string;
/** String being displayed as the message in the error alert that may occur when the recognition fails on captured high-resolution images. iOS only. */
errorAlertMessage?: string;
/** String being displayed as the button text in the error alert that may occur when the recognition fails on captured high-resolution images. iOS only. */
errorAlertButtonText?: string;
/** Aspect ratio of finder frame (width \ height), which is used to build actual finder frame. Default is 1 - it is a square frame, which is good for QR capturing. */
finderAspectRatio?: AspectRatio;
/** Foreground color of the detection overlay. */
finderLineColor?: string;
/** Width of finder frame border. Default is 2. */
finderLineWidth?: number;
/** Controls whether the flash toggle button is hidden or not. iOS only. */
flashButtonHidden?: boolean;
/** Title of the flash toggle button. iOS only. */
flashButtonTitle?: string;
/** Controls whether the flash should be initially enabled. The default value is FALSE. */
flashEnabled?: boolean;
/** UI Interface orientation lock mode */
orientationLockMode?: OrientationLockMode;
/** The background color of the top toolbar. */
topBarBackgroundColor?: string;
/** The color of all active toggle buttons in the toolbar. */
topBarButtonsActiveColor?: string;
/** The color of all inactive toggle buttons in the toolbar. */
topBarButtonsInactiveColor?: string;
/** The background color of the user guidance hints. */
userGuidanceBackgroundColor?: string;
/** The text color of the user guidance hints. */
userGuidanceTextColor?: string;
/** Configuration that helps to override default hint values. */
userGuidanceStringValues?: CheckUserGuidanceStrings;
/** Controls whether buttons should use all capitals style, as defined by the Android Material Design. Defaults to TRUE. Android only. */
useButtonsAllCaps?: boolean;
/** Preview mode of the camera. FILL_IN or FIT_IN. Default is FILL_IN. Android only */
cameraPreviewMode?: CameraPreviewMode;
/** Whether touch-to-focus is enabled on camera preview. Enabled by default. Android only. */
touchToFocusEnabled?: boolean;
}
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get your free Trial LicenseWhat do you think of this documentation?
What can we do to improve it? Please be as detailed as you like.