diff --git a/api/mobile-web-capture.md b/api/mobile-web-capture.md index e14c138..fbe6fff 100644 --- a/api/mobile-web-capture.md +++ b/api/mobile-web-capture.md @@ -645,4 +645,45 @@ const mobileWebCapture = new Dynamsoft.MobileWebCapture({ const fileName = `New_Document_${Date.now().toString().slice(-5)}`; await mobileWebCapture.launch(fileName); })(); +``` + +### `MWCScanner` + +MWC can scan from objects that satisfy this interface. When unassigned, MWC uses DDS by default. + +#### Properties + +##### `initialize()` + +Initialize scanner resources. + +###### **Type** + +```typescript +async initialize(): Promise +``` + +#### `launch()` + +Launch the scanner, and return a promise of a scan result that resolves once the scan completes. This scan result contains an `_imageData` object which contains a `toBlob()` that returns the scanned image as a blob. `imageData` (**not `_imageData`**) must be set to `true`. + +##### **Type** + +```typescript +async launch(): Promise<{ + _imageData: { + toBlob() + }, + imageData: boolean, +}> +``` + +#### `dispose()` + +Destructor for the scanner object. + +##### **Type** + +```typescript +dispose(): void ``` \ No newline at end of file diff --git a/releasenotes/index.md b/releasenotes/index.md index f2230a4..0c7575c 100644 --- a/releasenotes/index.md +++ b/releasenotes/index.md @@ -14,15 +14,16 @@ permalink: /releasenotes/index.html ## 3.1.0 (05/01/2025) -The most notable improvement in this version is the pluggable scanner feature. This allows MWC to integrate any custom scanner, e.g. our existing [MRZ scanner]. +The most notable improvement in this version is the pluggable scanner feature. This allows MWC to integrate any custom scanner. ### Features 1. Add Pluggable Scanner feature which integrates any scanner satisfying the following: - 1. Implements the `ImplementMWCScanner` interface + 1. Implements the [`MWCScanner`](https://www.dynamsoft.com/mobile-web-capture/docs/api/mobile-web-capture.html#mwcscanner) interface 2. Implements a `launch()` method to return a result that includes: 1. `_imageData` with a `toBlob()` function - 2. `status.code` equal to `EnumresultStatus.RS_SUCCESS` + 2. `imageData: true` + 3. `status.code` equal to `EnumresultStatus.RS_SUCCESS` 2. Update Document Scanner to [version 1.2](https://github.com/Dynamsoft/document-scanner-javascript/releases/tag/v1.2.0) 3. Change MWC Header color to make the component visually distinct 4. Move the "Select All" and "Cancel" buttons to the header in the Document View