Appearance
Mobile Web Capture API Reference / MobileWebCaptureConfig
Interface: MobileWebCaptureConfig
The MobileWebCaptureConfig interface passes settings to the MobileWebCapture constructor to customize the UI, the workflow, and how documents leave the application.
Remarks
MobileWebCaptureConfig.license is the only property required to instantiate a MobileWebCapture object; MWC uses sensible defaults for everything else. The per-View configuration objects reach further into each View — see the customization guide for worked examples of each.
See
Example
javascript
const mobileWebCapture = new Dynamsoft.MobileWebCapture({
license: "YOUR_LICENSE_KEY_HERE",
ddvResourcePath: "./dist/libs/dynamsoft-document-viewer/dist/",
documentScannerConfig: {
scannerViewConfig: {
cameraEnhancerUIPath: "./dist/libs/dynamsoft-document-scanner/dist/document-scanner.ui.xml",
},
engineResourcePaths: {
std: "./dist/libs/dynamsoft-capture-vision-std/dist/",
dip: "./dist/libs/dynamsoft-image-processing/dist/",
core: "./dist/libs/dynamsoft-core/dist/",
license: "./dist/libs/dynamsoft-license/dist/",
cvr: "./dist/libs/dynamsoft-capture-vision-router/dist/",
ddn: "./dist/libs/dynamsoft-document-normalizer/dist/",
},
},
});Properties
container?
optionalcontainer?:string|HTMLElement
The container element, or a selector for it, holding the entire MWC UI.
Remarks
When omitted, MWC creates a container filling the viewport.
ddvResourcePath?
optionalddvResourcePath?:string
Path to the Dynamsoft Document Viewer resources — the .wasm engine files and stylesheet MWC loads at runtime.
Remarks
Set this to self-host the resources instead of loading them from the CDN. Self-hosting the scanner's own engine resources is configured separately, through MobileWebCaptureConfig.documentScannerConfig.
See
Default Value
"https://cdn.jsdelivr.net/npm/dynamsoft-document-viewer@3.2.0/dist"
documentScannerConfig?
optionaldocumentScannerConfig?:Omit<DocumentScannerConfig,"container"|"license"> &object
Configures the built-in Mobile Document Scanner used for capture.
Type Declaration
correctionViewConfig?
optionalcorrectionViewConfig?:Omit<DocumentCorrectionViewConfig,"container"|"templateFilePath"|"utilizedTemplateNames"|"_showCorrectionView">
resultViewConfig?
optionalresultViewConfig?:Omit<DocumentResultViewConfig,"container">
scannerViewConfig?
optionalscannerViewConfig?:Omit<DocumentScannerViewConfig,"container"|"templateFilePath"|"utilizedTemplateNames"|"_showCorrectionView">
Remarks
MWC owns the scanner's container and license, so those two properties are omitted here; everything else in the MDS configuration applies, including engineResourcePaths for self-hosting and showCorrectionView/showResultView for skipping steps of the capture workflow.
See
documentViewConfig?
optionaldocumentViewConfig?:Pick<DocumentViewConfig,"container"|"toolbarButtonsConfig">
Configures the DocumentView.
exportConfig?
optionalexportConfig?:ExportConfig
Handlers connecting MWC's upload, download, and delete features to your server.
Remarks
Which buttons appear depends on which handlers are defined — see ExportConfig.
historyViewConfig?
optionalhistoryViewConfig?:Pick<HistoryViewConfig,"container"|"toolbarButtonsConfig">
Configures the HistoryView.
libraryViewConfig?
optionallibraryViewConfig?:Pick<LibraryViewConfig,"container"|"toolbarButtonsConfig">
Configures the LibraryView.
license?
optionallicense?:string
The license key for using Mobile Web Capture.
Remarks
This is the only required property to instantiate a MobileWebCapture object. MWC and Mobile Document Scanner share license keys — a key for either works for both.
onClose?
optionalonClose?: () =>void
Runs when the user closes this Mobile Web Capture instance.
Returns
void
pageViewConfig?
optionalpageViewConfig?:Pick<PageViewConfig,"container"|"toolbarButtonsConfig">
Configures the PageView.
scanner?
optionalscanner?:MWCScanner
A custom scanner to capture pages with, in place of the built-in Mobile Document Scanner.
Remarks
Any object satisfying MWCScanner can be plugged in here. When omitted, MWC scans with Mobile Document Scanner, configured through MobileWebCaptureConfig.documentScannerConfig.
showLibraryView?
optionalshowLibraryView?:boolean
Whether the LibraryView is available, allowing the user to manage several documents at once.
Remarks
With the LibraryView disabled MWC manages a single document, and launch opens the DocumentView on it. With it enabled, launch opens the LibraryView unless it is given a document to open.
Default Value
false
transferViewConfig?
optionaltransferViewConfig?:Pick<TransferViewConfig,"container"|"toolbarButtonsConfig">
Configures the TransferView.