dwt 18.5.1 → 19.1.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.
@@ -42,7 +42,7 @@ export interface TextResult {
42
42
  */
43
43
  barcodeFormat: DynamsoftEnumsDBR.EnumBarcodeFormat | number;
44
44
  /**
45
- * Extra barcde formats.
45
+ * Extra barcode formats.
46
46
  */
47
47
  barcodeFormat_2: DynamsoftEnumsDBR.EnumBarcodeFormat_2 | number;
48
48
  /**
@@ -32,6 +32,11 @@ export interface PDF {
32
32
  * @path Specify the path of the PDF file.
33
33
  */
34
34
  IsTextBasedPDF(path: string): boolean;
35
+ /**
36
+ * Detect whether the local PDF file requires rasterization to be read.
37
+ * @path Specify the path of the PDF file.
38
+ */
39
+ IsRasterizationRequired(path: string): boolean;
35
40
  /**
36
41
  * @deprecated since version 18.4. This function will be removed in future versions. Use `SetReaderOptions` instead.
37
42
  * Set the convert mode.
@@ -186,6 +191,9 @@ export interface ReaderOptions {
186
191
  * Whether or not to render in grayscale. Default value: false.
187
192
  */
188
193
  renderGrayscale?: boolean;
189
- }
190
-
194
+ };
195
+ /**
196
+ * Set whether to preserve the original size when saving an unedited PDF. Default value: false.
197
+ */
198
+ preserveUnmodifiedOnSave?: boolean;
191
199
  }
@@ -70,7 +70,7 @@ export interface Webcam {
70
70
  * Set the specified camera property.
71
71
  * @param property Specify the property.
72
72
  * @param value Specify the value.
73
- * @param auto Specify whether the propery should change automatically.
73
+ * @param auto Specify whether the property should change automatically.
74
74
  */
75
75
  SetCameraControlPropertySetting(
76
76
  property: DynamsoftEnumsDWT.EnumDWT_CameraControlProperty | number,
@@ -95,7 +95,7 @@ export interface Webcam {
95
95
  * Set the specified video property.
96
96
  * @param property Specify the property.
97
97
  * @param value Specify the value.
98
- * @param auto Specify whether the propery should change automatically.
98
+ * @param auto Specify whether the property should change automatically.
99
99
  */
100
100
  SetVideoPropertySetting(
101
101
  property: DynamsoftEnumsDWT.EnumDWT_VideoProperty | number,
@@ -197,7 +197,7 @@ export interface VideoControlProperty {
197
197
  */
198
198
  GetValue(): number;
199
199
  /**
200
- * Return whether the property is set autmatically or not.
200
+ * Return whether the property is set automatically or not.
201
201
  */
202
202
  GetIfAuto(): boolean;
203
203
  }
@@ -219,7 +219,7 @@ export interface VideoControlPropertyExtra {
219
219
  */
220
220
  GetSteppingDelta(): number;
221
221
  /**
222
- * Return whether the property is set autmatically or not.
222
+ * Return whether the property is set automatically or not.
223
223
  */
224
224
  GetIfAuto(): boolean;
225
225
  }
@@ -229,7 +229,7 @@ export interface CameraControlProperty {
229
229
  */
230
230
  GetValue(): number;
231
231
  /**
232
- * Return whether the property is set autmatically or not.
232
+ * Return whether the property is set automatically or not.
233
233
  */
234
234
  GetIfAuto(): boolean;
235
235
  }
@@ -251,7 +251,7 @@ export interface CameraControlPropertyExtra {
251
251
  */
252
252
  GetSteppingDelta(): number;
253
253
  /**
254
- * Return whether the property is set autmatically or not.
254
+ * Return whether the property is set automatically or not.
255
255
  */
256
256
  GetIfAuto(): boolean;
257
257
  }
@@ -276,12 +276,12 @@ export interface DWTPro {
276
276
  */
277
277
  DeleteDWTObject(Id: string): boolean;
278
278
  /**
279
- * Return the WebTwain instance specified by its ContainerId or WebTwainId. If no parameter is provided, the first valid WebTwain instance is returnd.
279
+ * Return the WebTwain instance specified by its ContainerId or WebTwainId. If no parameter is provided, the first valid WebTwain instance is returned.
280
280
  * @param ContainerIdOrWebTwainId The ContainerId or WebTwainId.
281
281
  */
282
282
  GetWebTwain(ContainerIdOrWebTwainId?: string): WebTwain;
283
283
  /**
284
- * Return the WebTwain instance specified by its ContainerId or WebTwainId. If no parameter is provided, the first valid WebTwain instance is returnd.
284
+ * Return the WebTwain instance specified by its ContainerId or WebTwainId. If no parameter is provided, the first valid WebTwain instance is returned.
285
285
  * @param ContainerIdOrWebTwainId The ContainerId or WebTwainId.
286
286
  */
287
287
  GetWebTwainEx(ContainerIdOrWebTwainId?: string): WebTwain;
@@ -390,7 +390,7 @@ export interface DWTPro {
390
390
  * @param event Specify the event.
391
391
  * @param callback Specify the callback.
392
392
  */
393
- RegisterEvent(event: string, callback: (...args: any[]) => void): boolean;
393
+ RegisterEvent(event: string, callback: (...args: any[]) => void): void;
394
394
  /**
395
395
  * Remove all authorizations for accessing local resources.
396
396
  */
@@ -689,11 +689,11 @@ export interface DeviceConfiguration {
689
689
  */
690
690
  IfDuplexEnabled?: boolean;
691
691
  /**
692
- * Whether to close the built-in User Interface after aquisition. Only valid when {IfShowUI} is true.
692
+ * Whether to close the built-in User Interface after acquisition. Only valid when {IfShowUI} is true.
693
693
  */
694
694
  IfDisableSourceAfterAcquire?: boolean;
695
695
  /**
696
- * Whether to close source after aquisition.
696
+ * Whether to close source after acquisition.
697
697
  */
698
698
  IfCloseSourceAfterAcquire?:boolean;
699
699
  /**
@@ -771,7 +771,7 @@ export interface ScanSetup {
771
771
  */
772
772
  setupId?: string;
773
773
  /**
774
- * Whether to ignore or fail the acquistion when an exception is raised. Set "ignore" or "fail".
774
+ * Whether to ignore or fail the acquisition when an exception is raised. Set "ignore" or "fail".
775
775
  */
776
776
  exception?: string;
777
777
  /**
@@ -210,7 +210,7 @@ export interface WebTwainBuffer extends WebTwainIO {
210
210
  * @param index Specify the image.
211
211
  */
212
212
  IsBlankImageAsync(index: number, options?: {
213
- minBlockHeight?: number,//default value: 10
213
+ minBlockHeight?: number,//default value: 20
214
214
  maxBlockHeight?: number //default value: 30
215
215
  }): Promise < boolean > ;
216
216
  /**
@@ -28,7 +28,7 @@ export interface WebTwainEdit extends WebTwainBuffer {
28
28
  * @param index Specify the image.
29
29
  * @param value Specify the value of contrast.
30
30
  */
31
- ChangeContrastAsnyc(
31
+ ChangeContrastAsnyc(
32
32
  index: number,
33
33
  value: number
34
34
  ): Promise<boolean>;
@@ -165,14 +165,14 @@ export interface WebTwainEdit extends WebTwainBuffer {
165
165
  ) => void
166
166
  ): void;
167
167
  /**
168
- * Invert the colour of the pixels on the specified image.
168
+ * Invert the color of the pixels on the specified image.
169
169
  * @param index Specify the image.
170
170
  */
171
171
  Invert(
172
172
  index: number
173
173
  ): boolean;
174
174
  /**
175
- * Invert the colour of the pixels on the specified image.
175
+ * Invert the color of the pixels on the specified image.
176
176
  * @param index Specify the image.
177
177
  * @param successCallback A callback function that is executed if the request succeeds.
178
178
  * @param failureCallback A callback function that is executed if the request fails.
@@ -499,7 +499,7 @@ export interface WebTwainEdit extends WebTwainBuffer {
499
499
  bottom: number
500
500
  ): boolean;
501
501
  /**
502
- * Return or set the fill colour for the empty area on an image that has been cut/cropped/erased.
502
+ * Return or set the fill color for the empty area on an image that has been cut/cropped/erased.
503
503
  */
504
504
  BackgroundFillColor: number;
505
505
  /**
@@ -499,7 +499,7 @@ export interface WebTwainIO extends WebTwainUtil {
499
499
  * Upload the specified image via a HTTP Post request.
500
500
  * @param host The HTTP Host.
501
501
  * @param index Specify the image.
502
- * @param target The target wherethe request is sent.
502
+ * @param target The target where the request is sent.
503
503
  * @param type The format of the file.
504
504
  * @param fileName The file name.
505
505
  * @param onEmptyResponse A callback function that is executed if the response is empty.
@@ -523,7 +523,7 @@ export interface WebTwainIO extends WebTwainUtil {
523
523
  * Upload the specified image via a HTTP Post request.
524
524
  * @param host The HTTP Host.
525
525
  * @param index Specify the image.
526
- * @param target The target wherethe request is sent.
526
+ * @param target The target where the request is sent.
527
527
  * @param fileName The file name.
528
528
  * @param type The format of the file.
529
529
  * @param onEmptyResponse A callback function that is executed if the response is empty.
@@ -547,7 +547,7 @@ export interface WebTwainIO extends WebTwainUtil {
547
547
  /**
548
548
  * Upload all images in the buffer as a TIFF file via a HTTP Post request.
549
549
  * @param host The HTTP Host.
550
- * @param target The target wherethe request is sent.
550
+ * @param target The target where the request is sent.
551
551
  * @param fileName The file name.
552
552
  * @param onEmptyResponse A callback function that is executed if the response is empty.
553
553
  * @param onServerReturnedSomething A callback function that is executed if the response is not empty.
@@ -568,7 +568,7 @@ export interface WebTwainIO extends WebTwainUtil {
568
568
  /**
569
569
  * Upload all images in the buffer as a PDF file via a HTTP Post request.
570
570
  * @param host The HTTP Host.
571
- * @param target The target wherethe request is sent.
571
+ * @param target The target where the request is sent.
572
572
  * @param fileName The file name.
573
573
  * @param onEmptyResponse A callback function that is executed if the response is empty.
574
574
  * @param onServerReturnedSomething A callback function that is executed if the response is not empty.
@@ -589,7 +589,7 @@ export interface WebTwainIO extends WebTwainUtil {
589
589
  /**
590
590
  * Upload all selected images in the buffer as a PDF file via a HTTP Post request.
591
591
  * @param host The HTTP Host.
592
- * @param target The target wherethe request is sent.
592
+ * @param target The target where the request is sent.
593
593
  * @param fileName The file name.
594
594
  * @param onEmptyResponse A callback function that is executed if the response is empty.
595
595
  * @param onServerReturnedSomething A callback function that is executed if the response is not empty.
@@ -610,7 +610,7 @@ export interface WebTwainIO extends WebTwainUtil {
610
610
  /**
611
611
  * Upload all selected images in the buffer as a TIFF file via a HTTP Post request.
612
612
  * @param host The HTTP Host.
613
- * @param target The target wherethe request is sent.
613
+ * @param target The target where the request is sent.
614
614
  * @param fileName The file name.
615
615
  * @param onEmptyResponse A callback function that is executed if the response is empty.
616
616
  * @param onServerReturnedSomething A callback function that is executed if the response is not empty.
@@ -632,7 +632,7 @@ export interface WebTwainIO extends WebTwainUtil {
632
632
  * Upload the specified file via a HTTP Post request.
633
633
  * @param host The HTTP Host.
634
634
  * @param path Specify the file to upload.
635
- * @param target The target wherethe request is sent.
635
+ * @param target The target where the request is sent.
636
636
  * @param fileName The file name.
637
637
  * @param onEmptyResponse A callback function that is executed if the response is empty.
638
638
  * @param onServerReturnedSomething A callback function that is executed if the response is not empty.
@@ -9,6 +9,10 @@ export interface WebTwainUtil {
9
9
  * Return the error string.
10
10
  */
11
11
  readonly ErrorString: string;
12
+ /**
13
+ * The reason for returning the error is an extension of the ErrorString.
14
+ */
15
+ readonly ErrorCause: {code: number, message: string} | null;
12
16
  /**
13
17
  * Return or set the log level for debugging.
14
18
  */
@@ -31,7 +35,7 @@ export interface WebTwainUtil {
31
35
  */
32
36
  readonly ProductName: string;
33
37
  /**
34
- * Generate a URL to be used by a FileUpoader instance to fetch the data to upload.
38
+ * Generate a URL to be used by a FileUploader instance to fetch the data to upload.
35
39
  * @param indices Specify the images to upload.
36
40
  * @param type Specify the file type.
37
41
  * @param successCallback A callback function that is executed if the request succeeds.
@@ -17,12 +17,12 @@ export interface WebTwainViewer extends WebTwainAcquire {
17
17
  UnbindViewer(): boolean;
18
18
  /**
19
19
  * @deprecated since version 16.2. This property will be removed in future versions. Use `Viewer.background` instead.
20
- * Return or set the background colour of the viewer.
20
+ * Return or set the background color of the viewer.
21
21
  */
22
22
  BackgroundColor: number;
23
23
  /**
24
24
  * @deprecated since version 16.2. This property will be removed in future versions. Use function `Viewer.selectedPageBorder` instead.
25
- * Return or set the border colour for selected image(s).
25
+ * Return or set the border color for selected image(s).
26
26
  */
27
27
  SelectionImageBorderColor: number;
28
28
  /**
@@ -32,7 +32,7 @@ export interface WebTwainViewer extends WebTwainAcquire {
32
32
  FitWindowType: number;
33
33
  /**
34
34
  * @deprecated since version 16.2. This property will be removed in future versions. Use function `Viewer.fitWindow` instead.
35
- * Return or set the border colour for selected image(s).
35
+ * Return or set the border color for selected image(s).
36
36
  */
37
37
  IfFitWindow: boolean;
38
38
  /**
@@ -101,7 +101,7 @@ export interface DynamsoftViewer {
101
101
  readonly idPostfix: string;
102
102
  /**
103
103
  * [Scope] Main viewer
104
- * [Description] Return or set the background colour/image of the viewer.
104
+ * [Description] Return or set the background color/image of the viewer.
105
105
  * [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
106
106
  * Replace the previous `BackgroundColor` method.
107
107
  * Allow any CSS rules
@@ -232,6 +232,10 @@ export interface DynamsoftViewer {
232
232
  x: string; //Default is "center", values: "left", "right", "center".
233
233
  y: string; //Default is "center", values: "top", "bottom", "center"
234
234
  }
235
+ /**
236
+ * Whether the viewer removes the focus border after selecting with the Tab key. Default value: true.
237
+ */
238
+ disableFocusOutline: boolean; // default value: true
235
239
  /**
236
240
  * [Scope] Main viewer
237
241
  * [Description] Return the index of the next image of the currently selected image.
@@ -353,6 +357,10 @@ export interface DynamsoftViewer {
353
357
  columns: number,
354
358
  rows: number
355
359
  ): boolean;
360
+ /**
361
+ * Return the info of visible pages. It is useful to add elements to document page images in the viewer.
362
+ */
363
+ getVisiblePagesInfo(): VisiblePageInfo[];
356
364
  /**
357
365
  * [Scope] Global
358
366
  * [Description] Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
@@ -557,7 +565,7 @@ export interface ThumbnailViewerSettings {
557
565
  autoChangeIndex?: boolean;
558
566
  /**
559
567
  * [Scope] Thumbnail viewer
560
- * [Description] Return or set the background colour/image of the thumbnail viewer. The default value is white.
568
+ * [Description] Return or set the background color/image of the thumbnail viewer. The default value is white.
561
569
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
562
570
  * Allow any CSS rules
563
571
  */
@@ -656,7 +664,7 @@ export interface ImageEditor {
656
664
  };
657
665
  /**
658
666
  * [Scope] ImageEditor viewer
659
- * Set the selction box styling.
667
+ * Set the selection box styling.
660
668
  * @argument selectionBoxStyleSettings Settings for selection box.
661
669
  */
662
670
  updateSelectionBoxStyle(selectionBoxStyleSettings?: SelectionBoxStyleSettings): boolean;
@@ -694,13 +702,17 @@ export interface ThumbnailViewer {
694
702
  * @argument pageNumberSettings Settings for page numbers.
695
703
  */
696
704
  updatePageNumberStyle(pageNumberSettings?: PageNumberSettings): void;
705
+ /**
706
+ * Return the info of visible pages. It is useful to add elements to document page images in the viewer.
707
+ */
708
+ getVisiblePagesInfo(): VisiblePageInfo[];
697
709
  /**
698
710
  * [Scope] Thumbnail viewer
699
711
  * [Description] Specify an event listener for the viewer event.
700
712
  * @param name Specify the event name.
701
713
  * @param callback The event listener.
702
714
  */
703
- on(eventName: string, callback: (...param: any[]) => void): void;
715
+ on(eventName: string, callback: (event: ThumbnailViewerEvent | KeyboardEvent, domEvent?: MouseEvent) => void): void;
704
716
  /**
705
717
  * [Scope] Thumbnail viewer
706
718
  * [Description] Remove the event handler.
@@ -786,7 +798,7 @@ export interface ThumbnailViewer {
786
798
  autoChangeIndex: boolean;
787
799
  /**
788
800
  * [Scope] Thumbnail viewer
789
- * [Description] Return or set the background colour/image of the thumbnail viewer. The default value is white.
801
+ * [Description] Return or set the background color/image of the thumbnail viewer. The default value is white.
790
802
  * [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
791
803
  * Allow any CSS rules
792
804
  */
@@ -880,19 +892,98 @@ export interface ViewerEvent {
880
892
  */
881
893
  pageY: number;
882
894
  }
895
+ /**
896
+ * Info of a visible page.
897
+ */
898
+ export interface VisiblePageInfo {
899
+ /**
900
+ * The index of the document page.
901
+ */
902
+ pageIndex: number;
903
+ /**
904
+ * Whether the mouse is hovering over the document page.
905
+ */
906
+ isHovered: boolean;
907
+ /**
908
+ * Whether the document page is selected.
909
+ */
910
+ isSelected: boolean;
911
+ /**
912
+ * The width of the document page image container.
913
+ */
914
+ pageWidth: number;
915
+ /**
916
+ * The height of the document page image container.
917
+ */
918
+ pageHeight: number;
919
+ /**
920
+ * The x coordinate relative to the canvas.
921
+ */
922
+ canvasOffsetX: number;
923
+ /**
924
+ * The y coordinate relative to the canvas.
925
+ */
926
+ canvasOffsetY: number;
927
+ /**
928
+ * The x coordinate relative to the container of the viewer.
929
+ */
930
+ containerOffsetX: number;
931
+ /**
932
+ * The y coordinate relative to the container of the viewer.
933
+ */
934
+ containerOffsetY: number;
935
+ }
936
+
883
937
  export interface ThumbnailViewerEvent {
884
938
  /**
885
- * The index of the current image.
939
+ * The index of the current document page.
886
940
  */
887
941
  index: number;
888
942
  /**
889
- * The x-coordinate relative to the browser page.
943
+ * The mouse's x coordinate in the thumbnail image container relative to the top-left of the web page.
890
944
  */
891
945
  pageX: number;
892
946
  /**
893
- * The y-coordinate relative to the browser page.
947
+ * The mouse's y coordinate in the thumbnail image container relative to the top-left of the web page.
894
948
  */
895
949
  pageY: number;
950
+ /**
951
+ * The width of the thumbnail image container.
952
+ */
953
+ imageX: number;
954
+ /**
955
+ * The height of the thumbnail image container.
956
+ */
957
+ imageY: number;
958
+ /**
959
+ * The corresponding x coordinate in the original image.
960
+ */
961
+ pageHeight: number;
962
+ /**
963
+ * The corresponding y coordinate in the original image.
964
+ */
965
+ pageWidth: number;
966
+ /**
967
+ * The thumbnail image container's relative position.
968
+ */
969
+ position: {
970
+ /**
971
+ * The x coordinate relative to the container of the viewer.
972
+ */
973
+ canvasOffsetX: number;
974
+ /**
975
+ * The y coordinate relative to the container of the viewer.
976
+ */
977
+ canvasOffsetY: number;
978
+ /**
979
+ * The x coordinate relative to the canvas.
980
+ */
981
+ containerOffsetX: number;
982
+ /**
983
+ * The y coordinate relative to the canvas.
984
+ */
985
+ containerOffsetY: number;
986
+ }
896
987
  }
897
988
  export interface Area {
898
989
  left: number;
@@ -939,10 +1030,10 @@ export interface PageNumberSettings {
939
1030
  translateY?: number | string; //default: "", number unit: px, string value: "10px"/"10%", relative to itself
940
1031
  }
941
1032
  export interface SelectionBoxStyleSettings {
942
- borderColor?: string; //Default: rgba(0,0,0,1). Colour in "rgba(r, g, b, a)"
1033
+ borderColor?: string; //Default: rgba(0,0,0,1). Color in "rgba(r, g, b, a)"
943
1034
  borderWidth?: number; //Default: 1. Pixels. Width of individual pattern segments.
944
1035
  lineDash?: [number,number]; //Default: [5,2]. Pixels. Line spacing where x is shaded pixels and y is gap in pixels.
945
1036
  handleWidth?: number; //Default: 9. Pixels.
946
1037
  handleHeight?: number; //Default: 9. Pixels
947
- handleColor?: string; //Default: rgba(0,0,0,1). Colour in "rgba(r, g, b, a)"
1038
+ handleColor?: string; //Default: rgba(0,0,0,1). Color in "rgba(r, g, b, a)"
948
1039
  }
@@ -11,9 +11,9 @@
11
11
  * Product: Dynamsoft Web Twain
12
12
  * Web Site: http://www.dynamsoft.com
13
13
  *
14
- * Copyright 2022, Dynamsoft Corporation
14
+ * Copyright 2025, Dynamsoft Corporation
15
15
  * Author: Dynamsoft Support Team
16
- * Version: 18.4.2
16
+ * Version: 19.0
17
17
  */
18
18
  import Dynamsoft from "./Dynamsoft";
19
19
  export default Dynamsoft;