Skip to content

Commit 50cfea8

Browse files
authored
Merge pull request #95 from dynamsoft-docs/preview
update to internal commit ad4881c7
2 parents 40cae04 + 0a0c9ab commit 50cfea8

12 files changed

+284
-162
lines changed

api/document-scanner-v3.0.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,16 @@ interface DocumentScannerConfig {
116116

117117
#### Properties
118118

119-
| Property | Type | Description |
120-
| ----------------------- | ------------------------------ | --------------------------------------------------------------- |
121-
| `license` | `string` | The license key for using the `DocumentScanner`. |
122-
| `container` | `HTMLElement \| string` | The container element or selector for the `DocumentScanner` UI. |
123-
| `scannerViewConfig` | `DocumentScannerViewConfig` | Configuration settings for the scanner view. |
124-
| `resultViewConfig` | `DocumentResultViewConfig` | Configuration settings for the result view. |
125-
| `correctionViewConfig` | `DocumentCorrectionViewConfig` | Configuration settings for the correction view. |
126-
| `templateFilePath` | `string` | The file path to the document template used for scanning. |
127-
| `utilizedTemplateNames` | `UtilizedTemplateNames` | Specifies detection and correction templates. |
128-
| `engineResourcePaths` | `EngineResourcePaths` | Paths to the necessary resources for the scanning engine. |
119+
| Property | Type | Description |
120+
| ----------------------- | ------------------------------ | --------------------------------------------------------- |
121+
| `license` | `string` | The license key for using the `DocumentScanner`. |
122+
| `container` | ``HTMLElement | string`` | The container element or selector for the `DocumentScanner` UI. |
123+
| `scannerViewConfig` | `DocumentScannerViewConfig` | Configuration settings for the scanner view. |
124+
| `resultViewConfig` | `DocumentResultViewConfig` | Configuration settings for the result view. |
125+
| `correctionViewConfig` | `DocumentCorrectionViewConfig` | Configuration settings for the correction view. |
126+
| `templateFilePath` | `string` | The file path to the document template used for scanning. |
127+
| `utilizedTemplateNames` | `UtilizedTemplateNames` | Specifies detection and correction templates. |
128+
| `engineResourcePaths` | `EngineResourcePaths` | Paths to the necessary resources for the scanning engine. |
129129

130130
#### Example
131131
```typescript
@@ -263,12 +263,12 @@ interface DocumentResult {
263263

264264
#### Properties
265265

266-
| Property | Type | Description |
267-
| ----------------------- | ------------------------------------------ | ------------------------------------------------------------ |
268-
| `status` | `ResultStatus` | The status of the document scan (success, failed, canceled). |
269-
| `originalImageResult` | `OriginalImageResultItem["imageData"]` | The original captured image before correction. |
270-
| `correctedImageResult` | `NormalizedImageResultItem \| DSImageData` | The processed (corrected) image. |
271-
| `detectedQuadrilateral` | `Quadrilateral` | The detected document boundaries. |
266+
| Property | Type | Description |
267+
| ----------------------- | -------------------------------------- | ------------------------------------------------------------ |
268+
| `status` | `ResultStatus` | The status of the document scan (success, failed, canceled). |
269+
| `originalImageResult` | `OriginalImageResultItem["imageData"]` | The original captured image before correction. |
270+
| `correctedImageResult` | ``NormalizedImageResultItem | DSImageData`` | The processed (corrected) image. |
271+
| `detectedQuadrilateral` | `Quadrilateral` | The detected document boundaries. |
272272

273273
## Toolbar Button Configurations
274274

api/document-scanner.md

Lines changed: 85 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The `DocumentScanner` class handles the document scanning process, including ima
3232

3333
## Constructor
3434

35-
### DocumentScanner
35+
### `DocumentScanner`
3636

3737
#### Syntax
3838
```typescript
@@ -69,7 +69,7 @@ async launch(file?: File): Promise<DocumentResult>
6969
```
7070

7171
#### Returns
72-
- A `Promise` resolving to a `DocumentResult` object.
72+
- A `Promise` resolving to a [`DocumentResult`](#documentresult) object.
7373

7474
#### Example
7575
```typescript
@@ -119,16 +119,16 @@ interface DocumentScannerConfig {
119119

120120
#### Properties
121121

122-
| Property | Type | Description |
123-
| ----------------------- | ------------------------------ | --------------------------------------------------------------- |
124-
| `license` | `string` | The license key for using the `DocumentScanner`. |
125-
| `container` | `HTMLElement \| string` | The container element or selector for the `DocumentScanner` UI. |
126-
| `scannerViewConfig` | `DocumentScannerViewConfig` | Configuration settings for the scanner view. |
127-
| `resultViewConfig` | `DocumentResultViewConfig` | Configuration settings for the result view. |
128-
| `correctionViewConfig` | `DocumentCorrectionViewConfig` | Configuration settings for the correction view. |
129-
| `templateFilePath` | `string` | The file path to the document template used for scanning. |
130-
| `utilizedTemplateNames` | `UtilizedTemplateNames` | Specifies detection and correction templates. |
131-
| `engineResourcePaths` | `EngineResourcePaths` | Paths to the necessary resources for the scanning engine. |
122+
| Property | Type | Description |
123+
| ----------------------- | --------------------------------------------------------------- | --------------------------------------------------------- |
124+
| `license` | `string` | The license key for using the `DocumentScanner`. |
125+
| `container` | ``HTMLElement | string`` | The container element or selector for the `DocumentScanner` UI. |
126+
| `scannerViewConfig` | [`DocumentScannerViewConfig`](#documentscannerconfig) | Configuration settings for the scanner view. |
127+
| `resultViewConfig` | [`DocumentResultViewConfig`](#documentresultviewconfig) | Configuration settings for the result view. |
128+
| `correctionViewConfig` | [`DocumentCorrectionViewConfig`](#documentcorrectionviewconfig) | Configuration settings for the correction view. |
129+
| `templateFilePath` | `string` | The file path to the document template used for scanning. |
130+
| `utilizedTemplateNames` | [`UtilizedTemplateNames`](#utilizedtemplatenames) | Specifies detection and correction templates. |
131+
| `engineResourcePaths` | [`EngineResourcePaths`](#engineresourcepaths) | Paths to the necessary resources for the scanning engine. |
132132

133133
#### Example
134134
```typescript
@@ -170,18 +170,18 @@ interface DocumentScannerViewConfig {
170170

171171
#### Properties
172172

173-
| Property | Type | Description |
174-
| --------------------------------- | ----------------------- | ---------------------------------------------------------------------------------------- |
175-
| `templateFilePath` | `string` | Path to a Capture Vision template for scanning configuration. |
176-
| `cameraEnhancerUIPath` | `string` | Path to the UI (`.html` template file) for the scanner view. |
177-
| `container` | `HTMLElement` | The container element for the scanner view. |
178-
| `utilizedTemplateNames` | `UtilizedTemplateNames` | Capture Vision template names for detection and correction. |
179-
| `enableAutoCropMode` | `boolean` | The default auto-crop mode state. |
180-
| `enableSmartCaptureMode` | `boolean` | The default smart capture mode state. |
181-
| `scanRegion` | [`ScanRegion`](#scanregion) | Defines the region within the viewport to detect documents. |
182-
| `minVerifiedFramesForAutoCapture` | `number` | The minimum number of camera frames to detect document boundaries on Smart Capture mode. |
183-
| `showSubfooter` | `boolean` | Mode selector menu visibility. |
184-
| `showPoweredByDynamsoft` | `boolean` | Visibility of the Dynamsoft branding message. |
173+
| Property | Type | Description |
174+
| --------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------- |
175+
| `templateFilePath` | `string` | Path to a Capture Vision template for scanning configuration. |
176+
| `cameraEnhancerUIPath` | `string` | Path to the UI (`.html` template file) for the scanner view. |
177+
| `container` | `HTMLElement` | The container element for the scanner view. |
178+
| `utilizedTemplateNames` | `[`UtilizedTemplateNames`](#utilizedtemplatenames)` | Capture Vision template names for detection and correction. |
179+
| `enableAutoCropMode` | `boolean` | The default auto-crop mode state. |
180+
| `enableSmartCaptureMode` | `boolean` | The default smart capture mode state. |
181+
| `scanRegion` | [`ScanRegion`](#scanregion) | Defines the region within the viewport to detect documents. |
182+
| `minVerifiedFramesForAutoCapture` | `number` | The minimum number of camera frames to detect document boundaries on Smart Capture mode. |
183+
| `showSubfooter` | `boolean` | Mode selector menu visibility. |
184+
| `showPoweredByDynamsoft` | `boolean` | Visibility of the Dynamsoft branding message. |
185185

186186
#### Example
187187

@@ -209,11 +209,11 @@ interface DocumentCorrectionViewConfig {
209209

210210
#### Properties
211211

212-
| Property | Type | Description |
213-
| ---------------------- | -------------------------------------------- | --------------------------------------------------------- |
214-
| `container` | `HTMLElement` | The container element for the correction view. |
215-
| `toolbarButtonsConfig` | `DocumentCorrectionViewToolbarButtonsConfig` | Configuration for toolbar buttons in the correction view. |
216-
| `onFinish` | `(result: DocumentResult) => void` | Callback function triggered when correction is finished. |
212+
| Property | Type | Description |
213+
| ---------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
214+
| `container` | `HTMLElement` | The container element for the correction view. |
215+
| `toolbarButtonsConfig` | [`DocumentCorrectionViewToolbarButtonsConfig`](#documentcorrectionviewtoolbarbuttonsconfig) | Configuration for toolbar buttons in the correction view. |
216+
| `onFinish` | `(result: DocumentResult) => void` | Callback function triggered when correction is finished. |
217217

218218
#### Example
219219

@@ -245,12 +245,12 @@ interface DocumentResultViewConfig {
245245

246246
#### Properties
247247

248-
| Property | Type | Description |
249-
| ---------------------- | ------------------------------------------- | ----------------------------------------------------------- |
250-
| `container` | `HTMLElement` | The container element for the result view. |
251-
| `toolbarButtonsConfig` | `DocumentResultViewToolbarButtonsConfig` | Configuration for toolbar buttons in the result view. |
252-
| `onDone` | `(result: DocumentResult) => Promise<void>` | Callback function triggered when scanning is done. |
253-
| `onUpload` | `(result: DocumentResult) => Promise<void>` | Callback function triggered when uploading the scan result. |
248+
| Property | Type | Description |
249+
| ---------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------- |
250+
| `container` | `HTMLElement` | The container element for the result view. |
251+
| `toolbarButtonsConfig` | [`DocumentResultViewToolbarButtonsConfig`](#documentresultviewtoolbarbuttonsconfig) | Configuration for toolbar buttons in the result view. |
252+
| `onDone` | `(result: DocumentResult) => Promise<void>` | Callback function triggered when scanning is done. |
253+
| `onUpload` | `(result: DocumentResult) => Promise<void>` | Callback function triggered when uploading the scan result. |
254254

255255
#### Example
256256
```javascript
@@ -282,12 +282,12 @@ interface DocumentResult {
282282

283283
#### Properties
284284

285-
| Property | Type | Description |
286-
| ----------------------- | ------------------------------------------ | ------------------------------------------------------------ |
287-
| `status` | `ResultStatus` | The status of the document scan (success, failed, canceled). |
288-
| `originalImageResult` | `OriginalImageResultItem["imageData"]` | The original captured image before correction. |
289-
| `correctedImageResult` | `NormalizedImageResultItem \| DSImageData` | The processed (corrected) image. |
290-
| `detectedQuadrilateral` | `Quadrilateral` | The detected document boundaries. |
285+
| Property | Type | Description |
286+
| ----------------------- | ------------------------------------------- | ------------------------------------------------------------ |
287+
| `status` | `ResultStatus` | The status of the document scan (success, failed, canceled). |
288+
| `originalImageResult` | `OriginalImageResultItem["imageData"]` | The original captured image before correction. |
289+
| `correctedImageResult` | ``NormalizedImageResultItem | DSImageData`` | The processed (corrected) image. |
290+
| `detectedQuadrilateral` | `Quadrilateral` | The detected document boundaries. |
291291

292292
### `ScanRegion`
293293

@@ -383,15 +383,8 @@ const documentScanner = new Dynamsoft.DocumentScanner({
383383
### Configurable Buttons Per Each View
384384

385385
#### DocumentCorrectionViewToolbarButtonsConfig
386-
```typescript
387-
interface DocumentCorrectionViewToolbarButtonsConfig {
388-
fullImage?: ToolbarButtonConfig;
389-
detectBorders?: ToolbarButtonConfig;
390-
apply?: ToolbarButtonConfig;
391-
}
392-
```
393386

394-
#### DocumentCorrectionViewToolbarButtonsConfig
387+
##### Syntax
395388

396389
```typescript
397390
interface DocumentCorrectionViewToolbarButtonsConfig {
@@ -403,6 +396,8 @@ interface DocumentCorrectionViewToolbarButtonsConfig {
403396

404397
#### DocumentResultViewToolbarButtonsConfig
405398

399+
##### Syntax
400+
406401
```typescript
407402
interface DocumentResultViewToolbarButtonsConfig {
408403
retake?: ToolbarButtonConfig;
@@ -413,3 +408,44 @@ interface DocumentResultViewToolbarButtonsConfig {
413408
}
414409
```
415410

411+
## Assisting Interfaces
412+
413+
### `UtilizedTemplateNames`
414+
415+
[Dynamsoft Capture Vision template](https://www.dynamsoft.com/capture-vision/docs/core/parameters/file/capture-vision-template.html?lang=javascript) names for detection and correction. This typically does not need to be set, as DDS uses the default template.
416+
417+
#### Syntax
418+
419+
```typescript
420+
interface UtilizedTemplateNames {
421+
detect: string;
422+
normalize: string;
423+
}
424+
```
425+
426+
### `EngineResourcePaths`
427+
428+
Paths to extra resources such as `.wasm` engine files. The default paths point to CDNs and so may be left unset. You may set custom paths for the purpose of [self-hosting resources]({{ site.guides }}mobile-web-capture-customization.html#self-hosting-resource-files).
429+
430+
#### Syntax
431+
432+
```typescript
433+
interface EngineResourcePaths {
434+
"rootDirectory"?: string;
435+
"std"?: string | PathInfo;
436+
"dip"?: string | PathInfo;
437+
"dnn"?: string | PathInfo;
438+
"core"?: string | PathInfo;
439+
"license"?: string | PathInfo;
440+
"cvr"?: string | PathInfo;
441+
"utility"?: string | PathInfo;
442+
"dbr"?: string | PathInfo;
443+
"dlr"?: string | PathInfo;
444+
"ddn"?: string | PathInfo;
445+
"dcp"?: string | PathInfo;
446+
"dce"?: string | PathInfo;
447+
"dlrData"?: string | PathInfo;
448+
"ddv"?: string | PathInfo;
449+
"dwt"?: string | DwtInfo;
450+
}
451+
```

0 commit comments

Comments
 (0)