dwt 18.3.0 → 18.4.1

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.
@@ -3,6 +3,7 @@ import { WebTwainBuffer } from "./WebTwain.Buffer";
3
3
 
4
4
  export interface WebTwainEdit extends WebTwainBuffer {
5
5
  /**
6
+ * @deprecated since version 16.2. This function will be removed in future versions. Use `Viewer.createImageEditor` instead.
6
7
  * Show the built-in image editor. If called without any arguments while the editor is open, it'll close the editor.
7
8
  * @param divId Specify a div element to hold the editor.
8
9
  * @param width Specify the width of the editor.
@@ -353,8 +354,8 @@ export interface WebTwainEdit extends WebTwainBuffer {
353
354
  */
354
355
  BackgroundFillColor: number;
355
356
  /**
356
- * [Deprecation] Add text on an image.
357
- * [Alternative] Annotation feature to be added in a later version.
357
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Annotation feature to be added in a later version.
358
+ * Add text on an image.
358
359
  * @param index the index of the image that you want to add text to.
359
360
  * @param x the x coordinate for the text.
360
361
  * @param y the y coordinate for the text.
@@ -375,8 +376,8 @@ export interface WebTwainEdit extends WebTwainBuffer {
375
376
  backgroundOpacity: number
376
377
  ): boolean;
377
378
  /**
378
- * [Deprecation] Create the font for adding text using the method AddText.
379
- * [Alternative] Annotation feature to be added in a later version.
379
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Annotation feature to be added in a later version.
380
+ * Create the font for adding text using the method AddText.
380
381
  * @param height Specifies the desired height (in logical units) of the font.
381
382
  * The absolute value of nHeight must not exceed 16,384 device units after it is converted.
382
383
  * For all height comparisons, the font mapper looks for the largest font that does not
@@ -430,8 +431,8 @@ export interface WebTwainEdit extends WebTwainBuffer {
430
431
  faceName: string
431
432
  ): boolean;
432
433
  /**
433
- * [Deprecation] Decorates image of a specified index in buffer with rectangles of transparent color.
434
- * [Alternative] Annotation feature to be added in a later version.
434
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Annotation feature to be added in a later version.
435
+ * Decorates image of a specified index in buffer with rectangles of transparent color.
435
436
  * @param index specifies the index of image in buffer. The index is 0-based.
436
437
  * @param left Specify the rectangle (leftmost coordinate).
437
438
  * @param top Specify the rectangle (topmost coordinate).
@@ -24,11 +24,13 @@ export interface WebTwainIO extends WebTwainUtil {
24
24
  */
25
25
  HttpFieldNameOfUploadedImage: string;
26
26
  /**
27
- * [Deprecation] Return or set the password used to log into the HTTP server.
27
+ * @deprecated since version 10.1. This property will be removed in future versions.
28
+ * Return or set the password used to log into the HTTP server.
28
29
  */
29
30
  HTTPPassword: string;
30
31
  /**
31
- * [Deprecation] Return or set the user name used to log into the HTTP server.
32
+ * @deprecated since version 10.1. This property will be removed in future versions.
33
+ * Return or set the user name used to log into the HTTP server.
32
34
  */
33
35
  HTTPUserName: string;
34
36
  /**
@@ -73,42 +75,52 @@ export interface WebTwainIO extends WebTwainUtil {
73
75
  */
74
76
  TIFFCompressionType: DynamsoftEnumsDWT.EnumDWT_TIFFCompressionType | number;
75
77
  /**
78
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
76
79
  * Return or set the name of the person who creates the PDF document.
77
80
  */
78
81
  PDFAuthor: string;
79
82
  /**
83
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
80
84
  * Return or set the compression type of PDF files. This is a runtime property.
81
85
  */
82
86
  PDFCompressionType: DynamsoftEnumsDWT.EnumDWT_PDFCompressionType | number;
83
87
  /**
88
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
84
89
  * Return or set the date when the PDF document is created.
85
90
  */
86
91
  PDFCreationDate: string;
87
92
  /**
93
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
88
94
  * Return or set the name of the application that created the original document, if the PDF document is converted from another form.
89
95
  */
90
96
  PDFCreator: string;
91
97
  /**
98
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
92
99
  * Return or set the keywords associated with the PDF document.
93
100
  */
94
101
  PDFKeywords: string;
95
102
  /**
103
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
96
104
  * Return or set the date when the PDF document is last modified.
97
105
  */
98
106
  PDFModifiedDate: string;
99
107
  /**
108
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
100
109
  * Return or set the name of the application that converted the PDF document from its native.
101
110
  */
102
111
  PDFProducer: string;
103
112
  /**
113
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
104
114
  * Return or set the subject of the PDF document.
105
115
  */
106
116
  PDFSubject: string;
107
117
  /**
118
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
108
119
  * Return or set the title of the PDF document.
109
120
  */
110
121
  PDFTitle: string;
111
122
  /**
123
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use function `PDF.Write.Setup` instead.
112
124
  * Return or set the value of the PDF version.
113
125
  */
114
126
  PDFVersion: string;
@@ -348,6 +360,7 @@ export interface WebTwainIO extends WebTwainUtil {
348
360
  errorString: string) => void
349
361
  ): void;
350
362
  /**
363
+ * @deprecated since version 10.1. This function will be removed in future versions. Use `HTTPDownload` or `HTTPDownloadEx` instead.
351
364
  * Download the specified file via a HTTP Post request.
352
365
  * @param host The HTTP Host.
353
366
  * @param path Specify the path of the file to download.
@@ -432,6 +445,7 @@ export interface WebTwainIO extends WebTwainUtil {
432
445
  response: string) => void
433
446
  ): void;
434
447
  /**
448
+ * @deprecated since version 10.1. This property will be removed in future versions.
435
449
  * Upload the specified image via a HTTP Put request.
436
450
  * @param host The HTTP Host.
437
451
  * @param index Specify the image.
@@ -685,7 +699,8 @@ export interface WebTwainIO extends WebTwainUtil {
685
699
  errorString: string) => void
686
700
  ): void | boolean;
687
701
  /**
688
- * [Deprecation] Return or set how many threads can be used when you upload files through POST.
702
+ * @deprecated since version 16.1.1. This property will be removed in future versions.
703
+ * Return or set how many threads can be used when you upload files through POST.
689
704
  */
690
705
  MaxInternetTransferThreads: number;
691
706
  /**
@@ -832,14 +847,14 @@ export interface WebTwainIO extends WebTwainUtil {
832
847
  errorString: string) => void
833
848
  ): void | boolean;
834
849
  /**
835
- * [Deprecation] Return an index from the selected indices array. Read SelectedImagesIndices instead.
836
- * [Alternative] Read SelectedImagesIndices instead.
850
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use `SelectedImagesIndices` instead.
851
+ * Return an index from the selected indices array.
837
852
  * @param indexOfIndices Specify the index of the specified image.
838
853
  */
839
854
  SaveSelectedImagesToBase64Binary(indexOfIndices: number): number;
840
855
  /**
841
- * [Deprecation] Saves the selected images in the buffer to a base64 string.
842
- * [Alternative] Use ConvertToBase64 instead.
856
+ * @deprecated since version 16.1.1. This property will be removed in future versions. Use `ConvertToBase64` instead.
857
+ * Saves the selected images in the buffer to a base64 string.
843
858
  * @param successCallback A callback function that is executed if the request succeeds.
844
859
  * @param failureCallback A callback function that is executed if the request fails.
845
860
  * @argument result The resulting array of strings.
@@ -921,7 +936,8 @@ export interface WebTwainIO extends WebTwainUtil {
921
936
  flag: number
922
937
  ): boolean;
923
938
  /**
924
- * [Deprecation] Set a cookie string into the Http Header to be used when uploading scanned images through POST.
939
+ * @deprecated since version 16.1.1. This property will be removed in future versions.
940
+ * Set a cookie string into the Http Header to be used when uploading scanned images through POST.
925
941
  * @param cookie The cookie.
926
942
  */
927
943
  SetCookie(cookie: string): boolean;
@@ -932,6 +948,24 @@ export interface WebTwainIO extends WebTwainUtil {
932
948
  * @param type The format of the file.
933
949
  */
934
950
  ShareImages(fileName: string, indices: number[], type: DynamsoftEnumsDWT.EnumDWT_ImageType):Promise<void>;
951
+ /**
952
+ * Copy selected area to Blob or base64.
953
+ * @param index Image to be copied from.
954
+ * @param area Area of image to be copied. X,Y is top left corner origin, width and height is size of area to be copied.
955
+ * @param type The target image type of the blob/base64.
956
+ * @param imageFormatType Specify if the return should be Blob or base64 string. Only support blob or base64
957
+ */
958
+ OutputSelectedAreaAsync(
959
+ index: number,
960
+ area: {
961
+ x: number,
962
+ y: number,
963
+ width: number,
964
+ height: number
965
+ },
966
+ type: DynamsoftEnumsDWT.EnumDWT_ImageType | number,
967
+ imageFormatType: DynamsoftEnumsDWT.EnumDWT_ImageFormatType | number,
968
+ ): Promise < Blob|string > ;
935
969
  }
936
970
  export interface Base64Result {
937
971
  /**
@@ -22,6 +22,7 @@ export interface WebTwainUtil {
22
22
  */
23
23
  readonly ProductFamily: string;
24
24
  /**
25
+ * @deprecated since version 18.0. This property will be removed in future versions. Use `Dynamsoft.DWT.ProductKey` instead.
25
26
  * Return or set the ProductKey.
26
27
  */
27
28
  ProductKey: string;
@@ -76,6 +77,7 @@ export interface WebTwainUtil {
76
77
  */
77
78
  readonly VersionInfo: string;
78
79
  /**
80
+ * @deprecated since version 18.0. This function will be removed in future versions. Use property `Dynamsoft.DWT.ProductKey` instead.
79
81
  * Update / set the ProductKey.
80
82
  * @param productKey the ProductKey.
81
83
  */
@@ -3,6 +3,7 @@ import { DynamsoftEnumsDWT } from "./Dynamsoft.Enum";
3
3
 
4
4
  export interface WebTwainViewer extends WebTwainAcquire {
5
5
  /**
6
+ * @deprecated since version 16.2. This function will be removed in future versions. Use `Viewer.bind` and `Viewer.show` instead.
6
7
  * Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
7
8
  * @param elementId Specify an HTML element to create the viewer.
8
9
  */
@@ -10,58 +11,72 @@ export interface WebTwainViewer extends WebTwainAcquire {
10
11
  elementId: string
11
12
  ): boolean;
12
13
  /**
14
+ * @deprecated since version 16.2. This function will be removed in future versions. Use `Viewer.unbind` instead.
13
15
  * Unbind and destroy the viewer.
14
16
  */
15
17
  UnbindViewer(): boolean;
16
18
  /**
19
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `Viewer.background` instead.
17
20
  * Return or set the background colour of the viewer.
18
21
  */
19
22
  BackgroundColor: number;
20
23
  /**
24
+ * @deprecated since version 16.2. This property will be removed in future versions. Use function `Viewer.selectedPageBorder` instead.
21
25
  * Return or set the border colour for selected image(s).
22
26
  */
23
27
  SelectionImageBorderColor: number;
24
28
  /**
29
+ * @deprecated since version 16.2. This property will be removed in future versions. Use function `Viewer.fitWindow` instead.
25
30
  * Return or set how the image is fit in the viewer.
26
31
  */
27
32
  FitWindowType: number;
28
33
  /**
34
+ * @deprecated since version 16.2. This property will be removed in future versions. Use function `Viewer.fitWindow` instead.
29
35
  * Return or set the border colour for selected image(s).
30
36
  */
31
37
  IfFitWindow: boolean;
32
38
  /**
39
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `Viewer.height` instead.
33
40
  * Return or set the height of the viewer.
34
41
  */
35
42
  Height: number | string;
36
43
  /**
44
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `Viewer.width` instead.
37
45
  * Return or set the width of the viewer.
38
46
  */
39
47
  Width: number | string;
40
48
  /**
49
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `ViewerEvent.imageX` instead.
41
50
  * Return the horizontal coordinate of the mouse.
42
51
  */
43
52
  readonly MouseX: number;
44
53
  /**
54
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `ViewerEvent.imageY` instead.
45
55
  * Return the vertical coordinate of the mouse.
46
56
  */
47
57
  readonly MouseY: number;
48
58
  /**
59
+ * @deprecated since version 16.2. This function will be removed in future versions. Use `Viewer.cursor` instead.
49
60
  * Return or set the shape of the cursor.
50
61
  */
51
62
  MouseShape: boolean;
52
63
  /**
64
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `Viewer.ifAutoScroll` instead.
53
65
  * Return or set whether the thumbnails view scrolls when new images come in.
54
66
  */
55
67
  IfAutoScroll: boolean;
56
68
  /**
69
+ * @deprecated since version 16.2. This property will be removed in future versions. Use function `Viewer.updatePageNumberStyle` instead.
57
70
  * Return or set whether to show the page numbers.
58
71
  */
59
72
  ShowPageNumber: boolean;
60
73
  /**
74
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `Viewer.pageMargin` instead.
61
75
  * Return or set the margin between images (in pixels).
62
76
  */
63
77
  ImageMargin: number;
64
78
  /**
79
+ * @deprecated since version 16.2. This property will be removed in future versions. Use `Viewer.zoom` instead.
65
80
  * Return or set the zoom factor.
66
81
  */
67
82
  Zoom: number;
@@ -131,6 +146,7 @@ export interface DynamsoftViewer {
131
146
  */
132
147
  pageMargin: number | string;
133
148
  /**
149
+ * @deprecated since version 18.4. This property will be removed in future versions. Use function `updateSelectionBoxStyle` instead.
134
150
  * [Scope] Main viewer
135
151
  * [Description] Set the border color of the selected area.
136
152
  * [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
@@ -181,12 +197,14 @@ export interface DynamsoftViewer {
181
197
  */
182
198
  selectedPageBackground: string;
183
199
  /**
200
+ * @deprecated since version 17.3. This property will be removed in future versions. Use function `updatePageNumberStyle` instead.
184
201
  * [Scope] Main viewer
185
202
  * [Description] Whether to show the page number. The default value is false.
186
203
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
187
204
  */
188
205
  showPageNumber: boolean;
189
206
  /**
207
+ * @deprecated since version 17.3. This property will be removed in future versions. Use function `updateCheckboxStyle` instead.
190
208
  * [Scope] Main viewer
191
209
  * [Description] Whether to show the checkbox for multiple selected. The default value is false.
192
210
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
@@ -286,31 +304,37 @@ export interface DynamsoftViewer {
286
304
  * [Scope] Main viewer
287
305
  * [Description] Clear the selected area(s) on the current image.
288
306
  */
289
- clearSelectedAreas(): void;
307
+ clearSelectedAreas(): boolean;
290
308
  /**
291
309
  * [Scope] Main viewer
292
310
  * [Description] Set one or more rectangular area(s) on the specified image.
293
311
  * @param areas Specify the areas.
294
312
  */
295
- setSelectedAreas(areas: Area[]): void;
313
+ setSelectedAreas(areas: Area[]): boolean;
296
314
  /**
297
315
  * [Scope] Main viewer
298
316
  * [Description] Fit the image to the window
299
317
  * @param type Specify a type to fit. (width, height, both)
300
318
  */
301
- fitWindow(type?: 'height' | 'width'): void;
319
+ fitWindow(type?: 'height' | 'width'): boolean;
302
320
  /**
303
321
  * [Scope] Main viewer
304
322
  * Update checkbox style
305
323
  * @argument checkboxSettings Settings for checkboxex.
306
324
  */
307
- updateCheckboxStyle(checkboxSettings?: CheckboxSettings): void;
325
+ updateCheckboxStyle(checkboxSettings?: CheckboxSettings): boolean;
308
326
  /**
309
327
  * [Scope] Main viewer
310
328
  * Update page number style
311
329
  * @argument pageNumberSettings Settings for page numbers.
312
330
  */
313
- updatePageNumberStyle(pageNumberSettings?: PageNumberSettings): void;
331
+ updatePageNumberStyle(pageNumberSettings?: PageNumberSettings): boolean;
332
+ /**
333
+ * [Scope] Main viewer
334
+ * Sets the graphical style for the selection box in the Viewer.
335
+ * @argument selectionBoxStyleSettings Settings for selection box.
336
+ */
337
+ updateSelectionBoxStyle(selectionBoxStyleSettings?: SelectionBoxStyleSettings): boolean;
314
338
  /**
315
339
  * [Description] Set the CSS class name of the specified button defined in updateUISetting.
316
340
  * @param name Specify the button.
@@ -513,12 +537,14 @@ export interface ThumbnailViewerSettings {
513
537
  */
514
538
  allowResizing?: boolean;
515
539
  /**
540
+ * @deprecated since version 17.3. This property will be removed in future versions. Use `pageNumber` instead.
516
541
  * [Scope] Thumbnail viewer
517
542
  * [Description] Whether to show the page number. The default value is false.
518
543
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
519
544
  */
520
545
  showPageNumber?: boolean;
521
546
  /**
547
+ * @deprecated since version 17.3. This property will be removed in future versions. Use `checkbox` instead.
522
548
  * [Scope] Thumbnail viewer
523
549
  * [Description] Whether to show the checkbox for multiple selected. The default value is false.
524
550
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
@@ -627,7 +653,13 @@ export interface ImageEditor {
627
653
  zoomOrigin?: {
628
654
  x: string; //Default is "center", values: "left", "right", "center".
629
655
  y: string; //Default is "center", values: "top", "bottom", "center"
630
- };
656
+ };
657
+ /**
658
+ * [Scope] ImageEditor viewer
659
+ * Set the selction box styling.
660
+ * @argument selectionBoxStyleSettings Settings for selection box.
661
+ */
662
+ updateSelectionBoxStyle(selectionBoxStyleSettings?: SelectionBoxStyleSettings): boolean;
631
663
  }
632
664
  export interface ThumbnailViewer {
633
665
  /**
@@ -734,12 +766,14 @@ export interface ThumbnailViewer {
734
766
  */
735
767
  allowResizing: boolean;
736
768
  /**
769
+ * @deprecated since version 17.3. This property will be removed in future versions. Use function `updatePageNumberStyle` instead.
737
770
  * [Scope] Thumbnail viewer
738
771
  * [Description] Whether to show the page number. The default value is false.
739
772
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
740
773
  */
741
774
  showPageNumber: boolean;
742
775
  /**
776
+ * @deprecated since version 17.3. This property will be removed in future versions. Use function `updateCheckboxStyle` instead.
743
777
  * [Scope] Thumbnail viewer
744
778
  * [Description] Whether to show the checkbox for multiple selected. The default value is false.
745
779
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
@@ -904,3 +938,11 @@ export interface PageNumberSettings {
904
938
  translateX?: number | string; //default: "", number unit: px, string value: "10px"/"10%", relative to itself
905
939
  translateY?: number | string; //default: "", number unit: px, string value: "10px"/"10%", relative to itself
906
940
  }
941
+ export interface SelectionBoxStyleSettings {
942
+ borderColor?: string; //Default: rgba(0,0,0,1). Colour in "rgba(r, g, b, a)"
943
+ borderWidth?: number; //Default: 1. Pixels. Width of individual pattern segments.
944
+ lineDash?: [number,number]; //Default: [5,2]. Pixels. Line spacing where x is shaded pixels and y is gap in pixels.
945
+ handleWidth?: number; //Default: 9. Pixels.
946
+ handleHeight?: number; //Default: 9. Pixels
947
+ handleColor?: string; //Default: rgba(0,0,0,1). Colour in "rgba(r, g, b, a)"
948
+ }
@@ -12,19 +12,23 @@ export interface WebTwain extends WebTwainViewer {
12
12
  */
13
13
  Addon: Addon;
14
14
  /**
15
- * [Deprecation] This API is no longer needed.
15
+ * @deprecated since version 10.1. This property will be removed in future versions.
16
+ * This API is no longer needed.
16
17
  */
17
18
  AllowMultiSelect: boolean;
18
19
  /**
19
- * [Deprecation] This API is no longer needed.
20
+ * @deprecated since version 10.1. This property will be removed in future versions.
21
+ * This API is no longer needed.
20
22
  */
21
23
  AllowPluginAuthentication: boolean;
22
24
  /**
23
- * [Deprecation] This API is no longer needed.
25
+ * @deprecated since version 10.1. This property will be removed in future versions.
26
+ * This API is no longer needed.
24
27
  */
25
28
  AsyncMode: boolean;
26
29
  /**
27
- * [Deprecation] This API is no longer needed.
30
+ * @deprecated since version 10.1. This property will be removed in future versions.
31
+ * This API is no longer needed.
28
32
  */
29
33
  BorderStyle: DynamsoftEnumsDWT.EnumDWT_BorderStyle | number;
30
34
  /**
@@ -32,11 +36,13 @@ export interface WebTwain extends WebTwainViewer {
32
36
  */
33
37
  readonly bReady: boolean;
34
38
  /**
35
- * [Deprecation] This API is no longer needed.
39
+ * @deprecated since version 10.1. This property will be removed in future versions.
40
+ * This API is no longer needed.
36
41
  */
37
42
  BrokerProcessType: number;
38
43
  /**
39
- * [Deprecation] This API is no longer needed.
44
+ * @deprecated since version 10.1. This property will be removed in future versions.
45
+ * This API is no longer needed.
40
46
  */
41
47
  EnableInteractiveZoom: boolean;
42
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dwt",
3
- "version": "18.3.0",
3
+ "version": "18.4.1",
4
4
  "author": {
5
5
  "name": "Dynamsoft",
6
6
  "url": "https://www.dynamsoft.com"