@@ -32,7 +32,7 @@ The `DocumentScanner` class handles the document scanning process, including ima
32
32
33
33
## Constructor
34
34
35
- ### DocumentScanner
35
+ ### ` DocumentScanner `
36
36
37
37
#### Syntax
38
38
``` typescript
@@ -69,7 +69,7 @@ async launch(file?: File): Promise<DocumentResult>
69
69
```
70
70
71
71
#### Returns
72
- - A ` Promise ` resolving to a ` DocumentResult ` object.
72
+ - A ` Promise ` resolving to a [ ` DocumentResult ` ] ( #documentresult ) object.
73
73
74
74
#### Example
75
75
``` typescript
@@ -119,16 +119,16 @@ interface DocumentScannerConfig {
119
119
120
120
#### Properties
121
121
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. |
132
132
133
133
#### Example
134
134
``` typescript
@@ -170,18 +170,18 @@ interface DocumentScannerViewConfig {
170
170
171
171
#### Properties
172
172
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. |
185
185
186
186
#### Example
187
187
@@ -209,11 +209,11 @@ interface DocumentCorrectionViewConfig {
209
209
210
210
#### Properties
211
211
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. |
217
217
218
218
#### Example
219
219
@@ -245,12 +245,12 @@ interface DocumentResultViewConfig {
245
245
246
246
#### Properties
247
247
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. |
254
254
255
255
#### Example
256
256
``` javascript
@@ -282,12 +282,12 @@ interface DocumentResult {
282
282
283
283
#### Properties
284
284
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. |
291
291
292
292
### ` ScanRegion `
293
293
@@ -383,15 +383,8 @@ const documentScanner = new Dynamsoft.DocumentScanner({
383
383
### Configurable Buttons Per Each View
384
384
385
385
#### DocumentCorrectionViewToolbarButtonsConfig
386
- ``` typescript
387
- interface DocumentCorrectionViewToolbarButtonsConfig {
388
- fullImage? : ToolbarButtonConfig ;
389
- detectBorders? : ToolbarButtonConfig ;
390
- apply? : ToolbarButtonConfig ;
391
- }
392
- ```
393
386
394
- #### DocumentCorrectionViewToolbarButtonsConfig
387
+ ##### Syntax
395
388
396
389
``` typescript
397
390
interface DocumentCorrectionViewToolbarButtonsConfig {
@@ -403,6 +396,8 @@ interface DocumentCorrectionViewToolbarButtonsConfig {
403
396
404
397
#### DocumentResultViewToolbarButtonsConfig
405
398
399
+ ##### Syntax
400
+
406
401
``` typescript
407
402
interface DocumentResultViewToolbarButtonsConfig {
408
403
retake? : ToolbarButtonConfig ;
@@ -413,3 +408,44 @@ interface DocumentResultViewToolbarButtonsConfig {
413
408
}
414
409
```
415
410
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