Appearance
Mobile Document Scanner API Reference / DocumentScannerViewConfig
Interface: DocumentScannerViewConfig
Defined in: src/views/DocumentScannerView.ts:125
The DocumentScannerViewConfig interface passes settings to the DocumentScanner constructor through the DocumentScannerConfig to apply UI and business logic customizations for the DocumentScannerView.
Remarks
Only rare and edge-case scenarios require editing the UI template or MDS source code. MDS uses sensible default values for all omitted properties.
Example
javascript
const documentScanner = new Dynamsoft.DocumentScanner({
license: "YOUR_LICENSE_KEY_HERE", // Replace with your actual license key
scannerViewConfig: {
cameraEnhancerUIPath: "../dist/document-scanner.ui.xml", // Use the local file
},
});Properties
cameraEnhancerUIPath?
optionalcameraEnhancerUIPath?:string
Defined in: src/views/DocumentScannerView.ts:157
Path to the UI definition file (.xml) for the DocumentScannerView.
Remarks
This typically does not need to be set as MDS provides a default template for general use. You may set custom paths to self-host or customize the template, or fully self-host MDS.
See
Default Value
DEFAULT_DCE_UI_PATH
container?
optionalcontainer?:string|HTMLElement
Defined in: src/views/DocumentScannerView.ts:163
The HTML container element or selector for the DocumentScannerView UI.
enableAutoCropMode?
optionalenableAutoCropMode?:boolean
Defined in: src/views/DocumentScannerView.ts:209
Set the Auto-Crop mode effective upon entering the DocumentScannerView UI.
Remarks
Enabling Auto-Crop mode also enables Smart Capture mode.
Default Value
ts
false
@publicenableBoundsDetectionMode?
optionalenableBoundsDetectionMode?:boolean
Defined in: src/views/DocumentScannerView.ts:187
Set the document Bounds Detection mode effective upon entering the DocumentScannerView UI.
Remarks
Bounds Detection mode gets enabled when Smart Capture mode is enabled.
Default Value
ts
true
@publicenableFrameVerification?
optionalenableFrameVerification?:boolean
Defined in: src/views/DocumentScannerView.ts:252
Enable automatic frame verification for best quality capture. When enabled, track clarity scores to find the clearest frame.
Default Value
ts
true
@publicenableSmartCaptureMode?
optionalenableSmartCaptureMode?:boolean
Defined in: src/views/DocumentScannerView.ts:198
Set the Smart Capture mode effective upon entering the DocumentScannerView UI.
Remarks
Enabling Smart Capture mode also enables Bounds Detection mode. Smart Capture mode is enabled when Auto-Capture mode is enabled.
Default Value
ts
false
@publicminVerifiedFramesForAutoCapture?
optionalminVerifiedFramesForAutoCapture?:number
Defined in: src/views/DocumentScannerView.ts:228
Set the minimum number of camera frames to detect document boundaries in Smart Capture mode.
Remarks
Accepts integer values between 1 and 5, inclusive.
Default Value
ts
2
@publicscanRegion?
optionalscanRegion?:ScanRegion
Defined in: src/views/DocumentScannerView.ts:217
Define the region within the viewport to detect documents.
See
showPoweredByDynamsoft?
optionalshowPoweredByDynamsoft?:boolean
Defined in: src/views/DocumentScannerView.ts:244
Set the visibility of the Dynamsoft branding message.
Default Value
ts
true
@publicshowSubfooter?
optionalshowSubfooter?:boolean
Defined in: src/views/DocumentScannerView.ts:236
Set the visibility of the mode selector menu.
Default Value
ts
true
@publictemplateFilePath?
optionaltemplateFilePath?:string
Defined in: src/views/DocumentScannerView.ts:145
Path to the Capture Vision template file for scanning configuration.
utilizedTemplateNames?
optionalutilizedTemplateNames?:UtilizedTemplateNames
Defined in: src/views/DocumentScannerView.ts:176
Capture Vision template names for document detection and normalization.
Default Value
DEFAULT_TEMPLATE_NAMES
Remarks
This typically does not need to be set as MDS provides a default template for general use. You may set custom names to self-host resources or fully self-host MDS.