dwt 17.1.9 → 17.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +132 -133
  2. package/dist/addon/dbrjs/dbr-8.6.1.full.wasm +0 -0
  3. package/dist/addon/dbrjs/dbr-8.6.1.full.wasm.js +134 -0
  4. package/dist/addon/dbrjs/dbr-8.6.1.worker.js +113 -0
  5. package/dist/addon/dbrjs/dbr.js +11 -11
  6. package/dist/dist/DynamsoftServiceSetup-arm64.deb +0 -0
  7. package/dist/dist/DynamsoftServiceSetup-mips64el.deb +0 -0
  8. package/dist/dist/DynamsoftServiceSetup.deb +0 -0
  9. package/dist/dist/DynamsoftServiceSetup.msi +0 -0
  10. package/dist/dist/DynamsoftServiceSetup.pkg +0 -0
  11. package/dist/dist/DynamsoftServiceSetup.rpm +0 -0
  12. package/dist/dynamsoft.webtwain.min.js +678 -478
  13. package/dist/dynamsoft.webtwain.min.mjs +680 -480
  14. package/dist/src/dynamsoft.crypto-1.7.2.wasm +0 -0
  15. package/dist/src/dynamsoft.imageProc-1.7.2.wasm +0 -0
  16. package/dist/src/dynamsoft.imageProc-sn-1.7.2.wasm +0 -0
  17. package/dist/src/dynamsoft.imagecore-1.7.2.wasm +0 -0
  18. package/dist/src/dynamsoft.imageio-1.7.2.wasm +0 -0
  19. package/dist/src/dynamsoft.imageio_wasm-1.7.2.js +115 -0
  20. package/dist/src/dynamsoft.lts.js +9 -9
  21. package/dist/src/dynamsoft.pdfReader-1.7.2.wasm +0 -0
  22. package/dist/src/dynamsoft.pdfReader_wasm-1.7.2.js +90 -0
  23. package/dist/src/dynamsoft.pdfWriter-1.7.2.wasm +0 -0
  24. package/dist/src/dynamsoft.viewer.css +3 -2
  25. package/dist/src/dynamsoft.viewer.js +2 -2
  26. package/dist/src/dynamsoft.webtwain.css +294 -60
  27. package/dist/src/{dynamsoft.crypto-1.7.1.wasm → fastcomp/dynamsoft.crypto-1.7.2.wasm} +0 -0
  28. package/dist/src/fastcomp/dynamsoft.imageProc-1.7.2.wasm +0 -0
  29. package/dist/src/fastcomp/dynamsoft.imagecore-1.7.2.wasm +0 -0
  30. package/dist/src/fastcomp/dynamsoft.imageio-1.7.2.wasm +0 -0
  31. package/dist/src/fastcomp/dynamsoft.imageio_wasm-1.7.2.js +115 -0
  32. package/dist/src/fastcomp/dynamsoft.pdfWriter-1.7.2.wasm +0 -0
  33. package/dist/types/Addon.Camera.d.ts +108 -0
  34. package/dist/types/Dynamsoft.Enum.d.ts +2 -1
  35. package/dist/types/Dynamsoft.d.ts +17 -0
  36. package/dist/types/WebTwain.Buffer.d.ts +29 -1
  37. package/dist/types/WebTwain.Edit.d.ts +18 -0
  38. package/dist/types/WebTwain.Viewer.d.ts +48 -3
  39. package/dist/types/index.d.ts +2 -2
  40. package/package.json +3 -3
  41. package/samples/1.AcquireImage.html +1 -21
  42. package/samples/10.ScanOrCapture.html +16 -23
  43. package/samples/2.CustomScan.html +2 -22
  44. package/samples/3.LoadAndSaveImages.html +1 -20
  45. package/samples/4.PDFRasterizer.html +17 -22
  46. package/samples/5.Edit.html +1 -20
  47. package/samples/6.Navigation.html +2 -21
  48. package/samples/7.Thumbnail.html +1 -20
  49. package/samples/8.OCRADocument.html +5 -25
  50. package/samples/9.ReadBarcode.html +1 -21
  51. package/dist/addon/dbrjs/dbr-8.2.5.full.wasm +0 -0
  52. package/dist/addon/dbrjs/dbr-8.2.5.full.wasm.js +0 -243
  53. package/dist/addon/dbrjs/dbr-8.2.5.worker.js +0 -112
  54. package/dist/src/dynamsoft.imageProc-1.7.1.wasm +0 -0
  55. package/dist/src/dynamsoft.imagecore-1.7.1.wasm +0 -0
  56. package/dist/src/dynamsoft.imageio-1.7.1.wasm +0 -0
  57. package/dist/src/dynamsoft.imageio_wasm-1.7.1.js +0 -106
  58. package/dist/src/dynamsoft.pdfReader-1.7.1.wasm +0 -0
  59. package/dist/src/dynamsoft.pdfWriter-1.7.1.wasm +0 -0
  60. package/dist/types/README.md +0 -16
@@ -77,6 +77,11 @@ export interface Camera {
77
77
  mode?: string,
78
78
  fill?: boolean
79
79
  ): Promise<Resolution>;
80
+ /**
81
+ * Start streaming video from the current camera in the viewer.
82
+ * @param scanConfiguration The scanConfiguration settings. If not set, the default setting is used.
83
+ */
84
+ scanDocument(scanConfiguration?: ScanConfiguration): Promise<Resolution>;
80
85
  /**
81
86
  * Close the camera and hide the video streaming UI.
82
87
  */
@@ -123,3 +128,106 @@ export interface ViewerEvent {
123
128
  */
124
129
  pageY: number;
125
130
  }
131
+ export interface ScanConfiguration {
132
+ element?: HTMLDivElement; //Bind the elment or elment id.
133
+ //After binding, display the video in the spcified element, otherwise, display the video in full screen.
134
+
135
+ scannerViewer?: {
136
+ deviceId?: string; //camera id
137
+ maxDocuments?:number; //The maximum documents can be captured/loaded in to the buffer.
138
+ enableBorderDetection?: boolean; //Whether to enable border detection. The default value is true.
139
+ fullScreen?: boolean; //Whether to display the video in full screen. The default value is false.
140
+ polygonStyle?:{ //The sytle of the auto detect border.
141
+ stroke?: string; //default: "#fe8e14". Only supports #16 hexadecimal.
142
+ strokeWidth?: string; //default: "2px"
143
+ dash?: string; //The allowed value are "solid" and "dashed", the default value is "solid".
144
+ };
145
+
146
+ resolution?: {
147
+ visibility?: boolean; //Whether to display the resolution icon in the upper left corner. The default value is true.
148
+ valueList?: any;
149
+ defaultValue?: Resolution; //Set the default value according to the value set in the valueList.
150
+ };
151
+
152
+ autoScan?: { //Automatically capture when a clear document is detected. Only applicable to video scanning.
153
+ visibility?: boolean; //Whether to display the automatic scan icon. The default value is true.
154
+ enableAutoScan?: boolean; //Whether to enable automatic scan. The default value is false.
155
+ };
156
+
157
+ autoDetect?: { //Only applicable to video scanning.
158
+ visibility?: boolean; //Whether to display the automatic border detection icon. The default value is true.
159
+ enableAutoDetect?: boolean; //Whether to enable automatic border detection. The default value is false.
160
+ acceptedPolygonConfidence?:number; //The default value is 80. The higher the setting, the more accurate the automatic border detection.
161
+ fpsLimit?: number; //The maximum number of frames detected per second. The default value is 3.
162
+ acceptedBlurryScore?:number; //The default value is 0.
163
+ autoCaptureDelay?: number; //The default value is 1000ms.
164
+ };
165
+
166
+
167
+ continuousScan?:{ //Only applicable to video scanning.
168
+ visibility?: boolean; //Whether to display the continuous scan icon. The default value is true.
169
+ enableContinuousScan?: boolean; //Whether to enable continuous scan. The default value is true.
170
+ };
171
+
172
+ switchCamera?: { //The default camera is the rear camera.
173
+ visibility?: boolean; //Whether to display the switch camera icon. The default value is true.
174
+ };
175
+
176
+ loadLocalFile?: {
177
+ visibility?: boolean; //Whether to display the load local file icon. The default value is true.
178
+ };
179
+
180
+ funcConfirmExitContinuousScan?: (bExistImage: boolean) => void;
181
+ //funcConfirmExitContinuousScan is the callback funtion
182
+ //Return true:Exit continuous scan mode without saving the captured image data. Return false: Stay on the original viewer
183
+
184
+ funcConfirmExit?: (bExistImage: boolean) => void;
185
+ //funcConfirmExit is the callback funtion,
186
+ //Return true:End this capture without saving the image data. Return false: Stay on the original viewer
187
+ };
188
+
189
+ filterViewer?: {
190
+ visibility?: boolean; //Whether to display filter viewer. The default value is true.
191
+
192
+ insert?: { //Insert an image
193
+ visibility?: boolean; //Whether to display the insert icon. The default value is true.
194
+ position?: string; //Set whether to insert the image "before" or "after" the current image. The default value is "before".
195
+ };
196
+
197
+ remove?: { //Remove an image
198
+ visibility?: boolean; //Whether to display the remove icon. The default value is true.
199
+ };
200
+
201
+ rotateLeft?: {
202
+ visibility?: boolean; //Whether to display the rotate left icon. The default value is true.
203
+ };
204
+
205
+ filter?: {
206
+ visibility?: boolean; //Whether to display the filter icon. The default value is true.
207
+ valueList?:any;
208
+ defaultValue?: string; //Filter selected by default. By default, the original filter is selected.
209
+ };
210
+ exitDocumentScanAfterSave: boolean; //The default value is false.
211
+ };
212
+
213
+ cropViewer?: {
214
+ visibility?: boolean; //Whether to display the crop viewer. The default value is true.
215
+
216
+ polygonStyle?:{ //The polygon style in the crop viewer.
217
+ stroke?: string; //default : "#fe8e14". Only supports #16 hexadecimal.
218
+ strokeWidth?: string; //default: "2px"
219
+ dash?: string; //The allowed value are "solid" and "dashed", the default value is "solid".
220
+ };
221
+
222
+ rotateLeft?:{
223
+ visibility?: boolean; //Whether to display the rotate left icon. The default value is true.
224
+ };
225
+ rotateRight?:{
226
+ visibility?: boolean; //Whether to display the rotate right icon. The default value is true.
227
+ };
228
+ autoDetectBorder?:{
229
+ visibility?: boolean; //Whether to display the automatic border detection icon. The default value is true.
230
+ };
231
+ };
232
+ }
233
+
@@ -180,7 +180,8 @@ export namespace DynamsoftEnumsDWT {
180
180
  enum EnumDWT_ConvertMode {
181
181
  CM_RENDERALL = 1,
182
182
  CM_IMAGEONLY = 2,
183
- CM_AUTO = 3
183
+ CM_AUTO = 3,
184
+ CM_RENDERALLWITHANNOTATION = 4
184
185
  }
185
186
  enum EnumErrorCode {
186
187
  DBR_1D_LICENSE_INVALID = -10017,
@@ -294,6 +294,22 @@ export interface DWTPro {
294
294
  * @param WebTwainId The WebTwainId.
295
295
  */
296
296
  GetWebTwainEx(WebTwainId?: string): WebTwain;
297
+ /**
298
+ * Download and update the certificate on the local system.
299
+ * @param url The URL to download the certificate (typically a ZIP file).
300
+ * @param successCallback A callback function that is executed if the request succeeds.
301
+ * @param failureCallback A callback function that is executed if the request fails.
302
+ * @argument errorCode The error code.
303
+ * @argument errorString The error string.
304
+ */
305
+ UpdateCert(
306
+ url: string,
307
+ successCallback: () => void,
308
+ failureCallback: (
309
+ errorCode: number,
310
+ errorString: string
311
+ ) => void
312
+ ): void;
297
313
  /**
298
314
  * Whether or not an md5 header `dwt-md5` should be included in HTTP upload requests.
299
315
  */
@@ -429,6 +445,7 @@ export interface DWTPro {
429
445
  * Trial, UseDefaultInstallUI, ViewerJSIntegerited,
430
446
  * inited, _srcUseLocalService
431
447
  */
448
+ IfCheckDCP: boolean;
432
449
  }
433
450
  export interface DisplayInfo {
434
451
  loaderBarSource?: string;
@@ -263,7 +263,35 @@ export interface WebTwainBuffer extends WebTwainIO {
263
263
  */
264
264
  RemoveTag(tagName: string, indices?: number[]):boolean;
265
265
  /**
266
- * Get the the status of the tags.
266
+ * Get the status of the tags.
267
267
  */
268
268
  GetTagList(): any;
269
+ /**
270
+ * Get the status of the tags for a specific image.
271
+ * @param index Specify one image.
272
+ */
273
+ GetTagListByIndex(index:number): any;
274
+ /**
275
+ * Get the current file name.
276
+ */
277
+ GetCurrentFileName(): string;
278
+ /**
279
+ * Create the file.
280
+ * @param fileName Specify the file name.
281
+ */
282
+ CreateFile(fileName: string):boolean;
283
+ /**
284
+ * open the file.
285
+ * @param fileName Specify the file name.
286
+ */
287
+ OpenFile(fileName: string):boolean;
288
+ /**
289
+ * remove the file.
290
+ * @param fileName Specify the file name.
291
+ */
292
+ RemoveFile():boolean;
293
+ /**
294
+ * Get the info of the all files.
295
+ */
296
+ GetFileInfoList(): any;
269
297
  }
@@ -13,6 +13,24 @@ export interface WebTwainEdit extends WebTwainBuffer {
13
13
  width?: number,
14
14
  height?: number
15
15
  ): boolean;
16
+ /**
17
+ * Change the brightness of the specified image.
18
+ * @param index Specify the image.
19
+ * @param value Specify the value of brightness.
20
+ */
21
+ ChangeBrightnessAsync(
22
+ index: number,
23
+ value: number
24
+ ): Promise<boolean>;
25
+ /**
26
+ * Change the contrast of the specified image.
27
+ * @param index Specify the image.
28
+ * @param value Specify the value of contrast.
29
+ */
30
+ ChangeContrastAsnyc(
31
+ index: number,
32
+ value: number
33
+ ): Promise<boolean>;
16
34
  /**
17
35
  * Change the bit depth of the specified image.
18
36
  * @param index Specify the image.
@@ -182,7 +182,13 @@ export interface DynamsoftViewer {
182
182
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
183
183
  */
184
184
  showPageNumber: boolean;
185
- /**
185
+ /**
186
+ * [Scope] Main viewer
187
+ * [Description] Whether to show the checkbox for multiple selected. The default value is false.
188
+ * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
189
+ */
190
+ showCheckbox: boolean;
191
+ /**
186
192
  * [Scope] Main viewer
187
193
  * [Description] When set to true, will make sure the first image in the viewer is always selected when scrolling through multiple images.
188
194
  */
@@ -289,13 +295,19 @@ export interface DynamsoftViewer {
289
295
  setViewMode(
290
296
  columns: number,
291
297
  rows: number
292
- ): boolean;
298
+ ): boolean;
299
+ /**
300
+ * [Scope] Global
301
+ * [Description] Create a document webviewer with specified settings.
302
+ * @param templateName The document webviewer settings. If not set, the default setting is used.
303
+ */
304
+ createTemplate(templateName?: string): DocumentViewerTemplate;
293
305
  /**
294
306
  * [Scope] Global
295
307
  * [Description] Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
296
308
  * @param element Specify an HTML element to create the viewer.
297
309
  */
298
- bind(element: HTMLDivElement): boolean;
310
+ bind(element: HTMLDivElement, documentViewerTemplate?: DocumentViewerTemplate): boolean;
299
311
  /**
300
312
  * [Scope] Main viewer
301
313
  * [Description] Show the viewer (Main viewer, ImageEditor, ThumbnailViewer, CustomElement).
@@ -471,6 +483,12 @@ export interface ThumbnailViewerSettings {
471
483
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
472
484
  */
473
485
  showPageNumber?: boolean;
486
+ /**
487
+ * [Scope] Thumbnail viewer
488
+ * [Description] Whether to show the checkbox for multiple selected. The default value is false.
489
+ * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
490
+ */
491
+ showCheckbox?: boolean;
474
492
  /**
475
493
  * [Scope] Thumbnail viewer
476
494
  * [Description] When set to true, will make sure the first image in the viewer is always selected when scrolling through multiple images.
@@ -542,6 +560,8 @@ export interface CustomElement {
542
560
  * [Description] Delete the element.
543
561
  */
544
562
  dispose(): void;
563
+
564
+ element?: any;
545
565
  }
546
566
  export interface ImageEditor {
547
567
  /**
@@ -658,6 +678,12 @@ export interface ThumbnailViewer {
658
678
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
659
679
  */
660
680
  showPageNumber: boolean;
681
+ /**
682
+ * [Scope] Thumbnail viewer
683
+ * [Description] Whether to show the checkbox for multiple selected. The default value is false.
684
+ * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
685
+ */
686
+ showCheckbox: boolean;
661
687
  /**
662
688
  * [Scope] Thumbnail viewer
663
689
  * [Description] When set to true, will make sure the first image in the viewer is always selected when scrolling through multiple images.
@@ -762,3 +788,22 @@ export interface Area {
762
788
  right: number;
763
789
  bottom: number;
764
790
  }
791
+ export interface DocumentViewerTemplate {
792
+ /**
793
+ * Save button click event
794
+ */
795
+ onSaveFunc?: () => void;
796
+ /**
797
+ * Upload button click event
798
+ */
799
+ onUploadFunc?: () => void;
800
+ /**
801
+ * Remove button click event
802
+ */
803
+ onRemoveSelectedFunc?: () => void;
804
+ onExitFunc?: () => void;
805
+ /**
806
+ * Get CustomElement. Can display save & upload viewer in CustomElement.
807
+ */
808
+ getCustomElement(): CustomElement;
809
+ }
@@ -12,9 +12,9 @@
12
12
  * Product: Dynamsoft Web Twain
13
13
  * Web Site: http://www.dynamsoft.com
14
14
  *
15
- * Copyright 2021, Dynamsoft Corporation
15
+ * Copyright 2022, Dynamsoft Corporation
16
16
  * Author: Dynamsoft Support Team
17
- * Version: 16.2
17
+ * Version: 17.2
18
18
  */
19
19
  import Dynamsoft from "./Dynamsoft";
20
20
  export default Dynamsoft;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dwt",
3
- "version": "17.1.9",
3
+ "version": "17.2.0",
4
4
  "author": {
5
5
  "name": "Dynamsoft",
6
6
  "url": "https://www.dynamsoft.com"
@@ -16,7 +16,7 @@
16
16
  "dist",
17
17
  "samples"
18
18
  ],
19
- "homepage": "https://www.dynamsoft.com/Products/WebTWAIN_Overview.aspx",
19
+ "homepage": "https://www.dynamsoft.com/web-twain/overview/",
20
20
  "keywords": [
21
21
  "TWAIN",
22
22
  "JavaScript",
@@ -56,4 +56,4 @@
56
56
  "url": "https://github.com/Dynamsoft/Dynamic-Web-TWAIN"
57
57
  },
58
58
  "types": "dist/types"
59
- }
59
+ }
@@ -17,28 +17,8 @@
17
17
  <div id="dwtcontrolContainer"></div>
18
18
 
19
19
  <script type="text/javascript">
20
-
21
- /** v17.1 LICENSE ALERT - README
22
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
23
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
24
- * Note that network connection is required for this license to work.
25
- */
26
-
27
- /* When using your own license, please uncomment the following lines and fill in your own information. */
28
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
29
-
30
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
31
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
32
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
33
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
34
-
35
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
36
-
37
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
38
-
39
- /** LICENSE ALERT - THE END */
40
-
41
20
  Dynamsoft.DWT.ResourcesPath = "../dist";
21
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
42
22
  Dynamsoft.DWT.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
43
23
  window.onload = function () {
44
24
  if (Dynamsoft.Lib.env.bMobile) {
@@ -9,6 +9,12 @@
9
9
  <body style="padding: 30px;">
10
10
  <div id="notMobile">
11
11
  <h1>Acquire Images</h1>
12
+ <div id="divNoteDeploy" style="margin: 10px 0 10px;" >Make sure you deploy the sample to an webserver that
13
+ <ul>
14
+ <li style="margin: 5px 0 5px 20px; font-size: 12px;">Runs HTTPS</li>
15
+ <li style="margin-left: 20px;font-size: 12px;">Serves the *.wasm file with Content-Type: application/wasm.</li>
16
+ </ul>
17
+ </div>
12
18
  <label style="font-size: x-large;" id="H5CameraLabel"><input type="checkbox" id="H5Camera" />Use H5
13
19
  Camera</label>
14
20
  <select style="font-size: x-large;" id="source"></select><br />
@@ -19,28 +25,9 @@
19
25
  <div id="dwtcontrolContainer"></div>
20
26
  </div>
21
27
  <script type="text/javascript">
22
-
23
- /** v17.1 LICENSE ALERT - README
24
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
25
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
26
- * Note that network connection is required for this license to work.
27
- */
28
-
29
- /* When using your own license, please uncomment the following lines and fill in your own information. */
30
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
31
-
32
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
33
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
34
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
35
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
36
-
37
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
38
-
39
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
40
-
41
- /** LICENSE ALERT - THE END */
42
-
43
28
  Dynamsoft.DWT.ResourcesPath = "../dist";
29
+ Dynamsoft.DWT.UseCameraAddonWasm = true;
30
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
44
31
  Dynamsoft.DWT.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
45
32
  Dynamsoft.DWT.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: 600, Height: 800 }];
46
33
  var bWASMCamera = true, bWASM = false;
@@ -196,8 +183,14 @@
196
183
  SetIfWebcamPlayVideo(false);
197
184
  }, 50);
198
185
  };
199
- if (bWASMCamera)
200
- DWObject.Addon.Camera.capture().then(function (blob) { DWObject.Viewer.render(); funCaptureImage(); });
186
+ if (bWASMCamera){
187
+ var p = document.location.protocol;
188
+ if (p == 'https:' || p == 'http:')
189
+ DWObject.Addon.Camera.capture().then(function (blob) { DWObject.Viewer.render(); funCaptureImage(); });
190
+ else {
191
+ alert("HTTPS is required for accessing cameras.");
192
+ }
193
+ }
201
194
  else
202
195
  DWObject.Addon.Webcam.CaptureImage(funCaptureImage, funCaptureImage);
203
196
  }
@@ -36,29 +36,9 @@
36
36
  <input type="button" id="mobileFile" value="Acquire" style="font-size: x-large;display:none" onclick="LoadImage()" />
37
37
  <br />
38
38
  <div id="dwtcontrolContainer"></div>
39
- <script type="text/javascript">
40
-
41
- /** v17.1 LICENSE ALERT - README
42
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
43
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
44
- * Note that network connection is required for this license to work.
45
- */
46
-
47
- /* When using your own license, please uncomment the following lines and fill in your own information. */
48
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
49
-
50
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
51
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
52
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
53
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
54
-
55
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
56
-
57
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
58
-
59
- /** LICENSE ALERT - THE END */
60
-
39
+ <script type="text/javascript">
61
40
  Dynamsoft.DWT.ResourcesPath = "../dist";
41
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
62
42
  Dynamsoft.DWT.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady); // Register OnWebTwainReady event. This event fires as soon as Dynamic Web TWAIN is initialized and ready to be used
63
43
  window.onload = function () {
64
44
  if (Dynamsoft.Lib.env.bMobile) {
@@ -24,27 +24,8 @@
24
24
  <div id="dwtcontrolContainer"></div>
25
25
 
26
26
  <script type="text/javascript">
27
- /** v17.1 LICENSE ALERT - README
28
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
29
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
30
- * Note that network connection is required for this license to work.
31
- */
32
-
33
- /* When using your own license, please uncomment the following lines and fill in your own information. */
34
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
35
-
36
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
37
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
38
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
39
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
40
-
41
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
42
-
43
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
44
-
45
- /** LICENSE ALERT - THE END */
46
-
47
27
  Dynamsoft.DWT.ResourcesPath = "../dist";
28
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
48
29
  window.onload = function () {
49
30
  Dynamsoft.DWT.Containers = [{ContainerId:'dwtcontrolContainer', Width:600, Height:800}];
50
31
  Dynamsoft.DWT.Load();
@@ -9,32 +9,13 @@
9
9
  <body style="padding: 30px;">
10
10
  <input type="button" style="font-size: x-large;" id="acquireButton" value="Acquire" onclick="AcquireImage();" />
11
11
  <input type="button" style="font-size: x-large;" id="loadButton" value="Load PDFs" onclick="LoadImages();" />
12
+ <input type="button" style="font-size: x-large;" id="saveButton" value="Save PDFs" onclick="SaveWithFileDialog();" />
12
13
  <br />
13
14
  <br />
14
15
  <div id="dwtcontrolContainer"></div>
15
16
  <script type="text/javascript">
16
-
17
- /** v17.1 LICENSE ALERT - README
18
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
19
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
20
- * Note that network connection is required for this license to work.
21
- */
22
-
23
- /* When using your own license, please uncomment the following lines and fill in your own information. */
24
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
25
-
26
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
27
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
28
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
29
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
30
-
31
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
32
-
33
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
34
-
35
- /** LICENSE ALERT - THE END */
36
-
37
- Dynamsoft.DWT.ResourcesPath = "../dist";
17
+ Dynamsoft.DWT.ResourcesPath = "../dist";
18
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
38
19
  Dynamsoft.DWT.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
39
20
  window.onload = function () {
40
21
  if (Dynamsoft.Lib.env.bMobile) {
@@ -87,6 +68,20 @@
87
68
  );
88
69
  }
89
70
  }
71
+
72
+ function SaveWithFileDialog() {
73
+ if (DWObject) {
74
+ if (DWObject.HowManyImagesInBuffer > 0) {
75
+ DWObject.IfShowFileDialog = true;
76
+ DWObject.SaveAllAsPDF("DynamicWebTWAIN.pdf",
77
+ function () { },
78
+ function (errorCode, errorString) {
79
+ alert('Save as PDF:' + errorString);
80
+ }
81
+ );
82
+ }
83
+ }
84
+ }
90
85
  </script>
91
86
  </body>
92
87
 
@@ -21,27 +21,8 @@
21
21
  <div id="dwtcontrolContainer"></div>
22
22
 
23
23
  <script type="text/javascript">
24
- /** v17.1 LICENSE ALERT - README
25
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
26
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
27
- * Note that network connection is required for this license to work.
28
- */
29
-
30
- /* When using your own license, please uncomment the following lines and fill in your own information. */
31
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
32
-
33
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
34
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
35
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
36
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
37
-
38
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
39
-
40
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
41
-
42
- /** LICENSE ALERT - THE END */
43
-
44
24
  Dynamsoft.DWT.ResourcesPath = "../dist";
25
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
45
26
  window.onload = function () {
46
27
  Dynamsoft.DWT.Containers = [{ContainerId:'dwtcontrolContainer', Width:700, Height:800}];
47
28
  Dynamsoft.DWT.Load();
@@ -38,28 +38,9 @@
38
38
  <input style="font-size: x-large;" onclick="btnRemoveSelectedImages_onclick()" type="button" value="Remove Selected Images" />
39
39
  <input style="font-size: x-large;" onclick="btnRemoveAllImages_onclick()" type="button" value="Remove All Images" />
40
40
 
41
- <script type="text/javascript">
42
- /** v17.1 LICENSE ALERT - README
43
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
44
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
45
- * Note that network connection is required for this license to work.
46
- */
47
-
48
- /* When using your own license, please uncomment the following lines and fill in your own information. */
49
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
50
-
51
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
52
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
53
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
54
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
55
-
56
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
57
-
58
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
59
-
60
- /** LICENSE ALERT - THE END */
61
-
41
+ <script type="text/javascript">
62
42
  Dynamsoft.DWT.ResourcesPath = "../dist";
43
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
63
44
  window.onload = function () {
64
45
  Dynamsoft.DWT.Containers = [{ContainerId:'dwtcontrolContainer', Width:700, Height:600}];
65
46
  Dynamsoft.DWT.Load();
@@ -17,27 +17,8 @@
17
17
  </div>
18
18
 
19
19
  <script type="text/javascript">
20
- /** v17.1 LICENSE ALERT - README
21
- * The library requires a license to work, the APIs organizationID and handshakeCode specify how to acquire a license.
22
- * If nothing is specified, a 7-day (public) trial license will be used by default which is the case in this sample.
23
- * Note that network connection is required for this license to work.
24
- */
25
-
26
- /* When using your own license, please uncomment the following lines and fill in your own information. */
27
- /* To get a free trial, please visit https://www.dynamsoft.com/customer/license/trialLicense?product=dwt. */
28
-
29
- // Dynamsoft.DWT.organizationID = "YOUR-ORGANIZATION-ID";
30
- // Dynamsoft.DWT.handshakeCode = "A-SPECIFIC-HANDSHAKECODE";
31
- // Dynamsoft.DWT.sessionPassword = "PASSWORD-TO-PROTECT-YOUR-LICENSE"; // Important field to protect your license.
32
- // Dynamsoft.DWT.licenseServer = ["YOUR-OWN-MAIN-LTS", "YOUR-OWN-STANDBY-LTS"]; // Ignore this line if you are using Dynamsoft-hosting LTS
33
-
34
- /* The API "ProductKey" is an alternative way to license the library, the major difference is that it does not require a network. Contact support@dynamsoft.com for more information. */
35
-
36
- // Dynamsoft.DWT.ProductKey = "YOUR-PRODUCT-KEY";
37
-
38
- /** LICENSE ALERT - THE END */
39
-
40
20
  Dynamsoft.DWT.ResourcesPath = "../dist";
21
+ Dynamsoft.DWT.ProductKey = 't00881wAAAJiZxwKrauMDAnLQZ4prFe5v+GIzhfe6tY5KYmPHgMl/HdEi/Vt0gw0oYrLdhvNToW0YknBnPyJr0T5IkwNgUinIjHfOHUQH/gYsW0kWed4BaK4rng==';
41
22
  window.onload = function () {
42
23
  if (Dynamsoft && (!Dynamsoft.Lib.product.bChromeEdition)) {
43
24
  var ObjString = [];