From f4765b1359c61700b29e8088f81e34c8a8a714c3 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Sat, 10 May 2025 00:32:09 +0800 Subject: [PATCH 1/2] update to internal commit 2f2ed55e --- api/mobile-web-capture.md | 41 +++++++++++++++++++++++++++++++++++++++ releasenotes/index.md | 7 ++++--- 2 files changed, 45 insertions(+), 3 deletions(-) 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..1c22f31 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/mobilewebcapture.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 From a058c9d25300c781f18e1f1c3ab50aa88e4d4913 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Sat, 10 May 2025 00:39:12 +0800 Subject: [PATCH 2/2] update to internal commit a7f064aa --- releasenotes/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releasenotes/index.md b/releasenotes/index.md index 1c22f31..0c7575c 100644 --- a/releasenotes/index.md +++ b/releasenotes/index.md @@ -19,7 +19,7 @@ The most notable improvement in this version is the pluggable scanner feature. T ### Features 1. Add Pluggable Scanner feature which integrates any scanner satisfying the following: - 1. Implements the [`MWCScanner`](https://www.dynamsoft.com/mobile-web-capture/docs/api/mobilewebcapture.html#mwcscanner) 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. `imageData: true`