dwt 19.1.0 → 19.3.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.
- package/README.md +137 -57
- package/dist/dist/DynamicWebTWAINServiceSetup-arm64.deb +0 -0
- package/dist/dist/DynamicWebTWAINServiceSetup.deb +0 -0
- package/dist/dist/DynamicWebTWAINServiceSetup.msi +0 -0
- package/dist/dist/DynamicWebTWAINServiceSetup.pkg +0 -0
- package/dist/dist/DynamicWebTWAINServiceSetup.rpm +0 -0
- package/dist/dynamsoft.webtwain.min.js +227 -59
- package/dist/dynamsoft.webtwain.min.mjs +227 -59
- package/dist/src/dynamsoft.lts.js +10 -10
- package/dist/src/dynamsoft.webtwain.css +54 -13
- package/dist/src/dynamsoft.webtwain.viewer.css +3 -3
- package/dist/src/dynamsoft.webtwain.viewer.js +3 -3
- package/dist/types/Addon.OCRKit.d.ts +117 -0
- package/dist/types/Addon.OCRPro.d.ts +1 -1
- package/dist/types/Addon.PDF.d.ts +4 -0
- package/dist/types/Dynamsoft.Enum.d.ts +18 -0
- package/dist/types/Dynamsoft.d.ts +5 -0
- package/dist/types/RemoteScan.d.ts +3 -3
- package/dist/types/WebTwain.Acquire.d.ts +4 -0
- package/dist/types/WebTwain.Buffer.d.ts +4 -0
- package/dist/types/WebTwain.Edit.d.ts +1 -1
- package/dist/types/WebTwain.IO.d.ts +7 -1
- package/dist/types/WebTwain.Viewer.d.ts +9 -9
- package/dist/types/WebTwain.d.ts +2 -0
- package/dist/types/index.d.ts +1 -6
- package/dwt-openapi.yaml +5 -0
- package/legal.txt +1457 -0
- package/package.json +2 -2
- package/dist/addon/OCR.zip +0 -0
- package/dist/addon/OCRBasicLanguages/English.zip +0 -0
- package/dist/addon/OCRx64.zip +0 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { DynamsoftEnumsDWT } from "./Dynamsoft.Enum";
|
|
2
|
+
|
|
3
|
+
export interface OCRKit {
|
|
4
|
+
/**
|
|
5
|
+
* Return the OCR installation information.
|
|
6
|
+
*/
|
|
7
|
+
GetInstalledOCRInfo(): Promise<OCRInfo>;
|
|
8
|
+
/**
|
|
9
|
+
* Detect the page's orientation.
|
|
10
|
+
*/
|
|
11
|
+
DetectPageOrientation(
|
|
12
|
+
index: number,
|
|
13
|
+
settings?: {
|
|
14
|
+
detectionMode?: DynamsoftEnumsDWT.EnumDWT_PageOrientationDetectionMode | number
|
|
15
|
+
}
|
|
16
|
+
): Promise<AngleInfo>;
|
|
17
|
+
/**
|
|
18
|
+
* Perform OCR on the specified image in the buffer.
|
|
19
|
+
* @param index Specify the image.
|
|
20
|
+
* @param settings.language Specify the language for recognition, such as: "en","fr","es","de","it" or "pt".
|
|
21
|
+
* @param settings.pageOrientation Specify the page orientation.
|
|
22
|
+
* @param rects Specify the OCR region, which can be multiple.
|
|
23
|
+
*/
|
|
24
|
+
Recognize(
|
|
25
|
+
index: number,
|
|
26
|
+
options?: {
|
|
27
|
+
settings?: {
|
|
28
|
+
language?: string,
|
|
29
|
+
pageOrientation?: DynamsoftEnumsDWT.EnumDWT_PageOrientation | number,
|
|
30
|
+
},
|
|
31
|
+
rects?:Rect[]
|
|
32
|
+
}
|
|
33
|
+
): Promise<OCRResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Save the OCR result as a file.
|
|
36
|
+
* @param indices Specify the image(s).
|
|
37
|
+
* @param path The path to save the file.
|
|
38
|
+
* @param format Specify the output format.
|
|
39
|
+
*/
|
|
40
|
+
SaveToPath(indices: number[],
|
|
41
|
+
outputFormat: DynamsoftEnumsDWT.EnumDWT_OCRKitOutputFormat | number,
|
|
42
|
+
path: string): Promise<boolean>;
|
|
43
|
+
/**
|
|
44
|
+
* Save the OCR result as a blob.
|
|
45
|
+
* @param indices Specify the image(s).
|
|
46
|
+
* @param format Specify the output format.
|
|
47
|
+
*/
|
|
48
|
+
SaveAsBlob(indices: number[],
|
|
49
|
+
outputFormat:DynamsoftEnumsDWT.EnumDWT_OCRKitOutputFormat | number): Promise<Blob>;
|
|
50
|
+
/**
|
|
51
|
+
* Save the OCR result as a base64 string.
|
|
52
|
+
* @param indices Specify the image(s).
|
|
53
|
+
* @param format Specify the output format.
|
|
54
|
+
*/
|
|
55
|
+
SaveAsBase64(indices: number[],
|
|
56
|
+
outputFormat:DynamsoftEnumsDWT.EnumDWT_OCRKitOutputFormat | number): Promise<string>;
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
export interface OCRResult {
|
|
60
|
+
/**
|
|
61
|
+
* The imageId of the image which can be used to find the index.
|
|
62
|
+
*/
|
|
63
|
+
imageID: string;
|
|
64
|
+
/**
|
|
65
|
+
* The width and height of the image.
|
|
66
|
+
*/
|
|
67
|
+
dimensions: {width: number; height: number};
|
|
68
|
+
/**
|
|
69
|
+
* The rotation angle of the page and its confidence level.
|
|
70
|
+
*/
|
|
71
|
+
orientation: {value: number; confidence: number};
|
|
72
|
+
blocks:{
|
|
73
|
+
geometry: Rect;
|
|
74
|
+
lines: {
|
|
75
|
+
/**
|
|
76
|
+
* The region of the line.
|
|
77
|
+
*/
|
|
78
|
+
geometry: Rect;
|
|
79
|
+
words?:{
|
|
80
|
+
/**
|
|
81
|
+
* OCR result of the word.
|
|
82
|
+
*/
|
|
83
|
+
value: string;
|
|
84
|
+
/**
|
|
85
|
+
* The confidence level of the OCR result of the word.
|
|
86
|
+
*/
|
|
87
|
+
confidence: number;
|
|
88
|
+
/**
|
|
89
|
+
* The region of the word.
|
|
90
|
+
*/
|
|
91
|
+
geometry: Rect;
|
|
92
|
+
}[];
|
|
93
|
+
}[];
|
|
94
|
+
}[];
|
|
95
|
+
}
|
|
96
|
+
export interface OCRInfo {
|
|
97
|
+
/**
|
|
98
|
+
* Return the OCR version.
|
|
99
|
+
*/
|
|
100
|
+
version: string;
|
|
101
|
+
}
|
|
102
|
+
export interface AngleInfo {
|
|
103
|
+
/**
|
|
104
|
+
* Return the page's orientation.
|
|
105
|
+
*/
|
|
106
|
+
angle: DynamsoftEnumsDWT.EnumDWT_PageOrientation |number;
|
|
107
|
+
/**
|
|
108
|
+
* Return the confidence level of the page's orientation.
|
|
109
|
+
*/
|
|
110
|
+
confidence:number;
|
|
111
|
+
}
|
|
112
|
+
export interface Rect {
|
|
113
|
+
left: number;
|
|
114
|
+
top: number;
|
|
115
|
+
right: number;
|
|
116
|
+
bottom: number;
|
|
117
|
+
}
|
|
@@ -160,6 +160,10 @@ export interface PDFWSettings {
|
|
|
160
160
|
* When saving a PDF, you can set a password for protection.
|
|
161
161
|
*/
|
|
162
162
|
password?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Specify the PDFA version. For example, 'pdf/a-1b' or "pdf/a-2b".
|
|
165
|
+
*/
|
|
166
|
+
pdfaVersion?: string;
|
|
163
167
|
}
|
|
164
168
|
export interface ReaderOptions {
|
|
165
169
|
/**
|
|
@@ -64,6 +64,24 @@ export namespace DynamsoftEnumsDBR {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
export namespace DynamsoftEnumsDWT {
|
|
67
|
+
/** OCR Page Orientation Detection Mode */
|
|
68
|
+
enum EnumDWT_PageOrientationDetectionMode {
|
|
69
|
+
FAST = 0,
|
|
70
|
+
BALANCE = 1,
|
|
71
|
+
PRECISION = 2
|
|
72
|
+
}
|
|
73
|
+
enum EnumDWT_PageOrientation {
|
|
74
|
+
AUTO = -1,
|
|
75
|
+
ANGLE_0 = 0,
|
|
76
|
+
ANGLE_90 = 90,
|
|
77
|
+
ANGLE_180 = 180,
|
|
78
|
+
ANGLE_270 = 270
|
|
79
|
+
}
|
|
80
|
+
enum EnumDWT_OCRKitOutputFormat{
|
|
81
|
+
TEXT = 0,
|
|
82
|
+
PDF_PLAIN_TEXT = 1,
|
|
83
|
+
PDF_WITH_EXTRA_TEXTLAYER = 2
|
|
84
|
+
}
|
|
67
85
|
/** OCR Languages */
|
|
68
86
|
enum EnumDWT_OCRLanguage {
|
|
69
87
|
OCRL_ENG = "eng",
|
|
@@ -487,6 +487,11 @@ export interface DWTPro {
|
|
|
487
487
|
* Whether to check certificates issue in detail, default value is true.
|
|
488
488
|
*/
|
|
489
489
|
IfCheckCert: boolean;
|
|
490
|
+
/**
|
|
491
|
+
* Dynamsoft.DWT.EnableLocalNetworkMixedContent
|
|
492
|
+
* If enabled, the library will use HTTP to communicate with the service. The host must be localhost or 127.0.0.1. The default value is false.
|
|
493
|
+
*/
|
|
494
|
+
EnableLocalNetworkMixedContent: boolean;
|
|
490
495
|
}
|
|
491
496
|
export interface DisplayInfo {
|
|
492
497
|
loaderBarSource?: string;
|
|
@@ -56,15 +56,15 @@ export interface RemoteScanObject {
|
|
|
56
56
|
/**
|
|
57
57
|
* @param forceRefresh Default value: false.
|
|
58
58
|
*/
|
|
59
|
-
|
|
59
|
+
getServices(forceRefresh?: boolean): Promise<ServiceInfo[]>;
|
|
60
60
|
/**
|
|
61
61
|
* Set the default dynamsoftService for storing the data
|
|
62
62
|
*/
|
|
63
|
-
|
|
63
|
+
setDefaultService(serviceInfo:ServiceInfo):Promise<void>;
|
|
64
64
|
/**
|
|
65
65
|
* Get the default dynamsoftService.
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
getDefaultService():ServiceInfo|null;
|
|
68
68
|
/**
|
|
69
69
|
* Get image(s) form dynamsoftService.
|
|
70
70
|
* @param indices Specify the image(s).
|
|
@@ -355,6 +355,10 @@ export interface WebTwainAcquire extends WebTwainEdit {
|
|
|
355
355
|
* Return the value of the top edge of the current image frame (in Unit).
|
|
356
356
|
*/
|
|
357
357
|
readonly ImageLayoutFrameTop: number;
|
|
358
|
+
/**
|
|
359
|
+
* Return the frame number of the current image.
|
|
360
|
+
*/
|
|
361
|
+
readonly ImageLayoutFrameNumber: number;
|
|
358
362
|
/**
|
|
359
363
|
* Return the document number of the current image.
|
|
360
364
|
*/
|
|
@@ -32,6 +32,10 @@ export interface WebTwainBuffer extends WebTwainIO {
|
|
|
32
32
|
* @param tag The tag used as the filter.
|
|
33
33
|
*/
|
|
34
34
|
FilterImagesByTag(tag: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Stop filtering images by tag.
|
|
37
|
+
*/
|
|
38
|
+
ClearFilter(): boolean;
|
|
35
39
|
/**
|
|
36
40
|
* Return the pixel bit depth of the specified image.
|
|
37
41
|
* @param index Specify the image.
|
|
@@ -770,6 +770,7 @@ export interface WebTwainIO extends WebTwainUtil {
|
|
|
770
770
|
*/
|
|
771
771
|
MaxUploadImageSize: number;
|
|
772
772
|
/**
|
|
773
|
+
* @deprecated since version 19.3. This property will be removed in future versions. Use function `PrintEx` instead.
|
|
773
774
|
* Export all image data in the buffer to a new browser window and use the browser's built-in print feature to print the image(s).
|
|
774
775
|
* @param useOSPrintWindow Whether to use the print feature of the operating system instead.
|
|
775
776
|
*/
|
|
@@ -777,8 +778,9 @@ export interface WebTwainIO extends WebTwainUtil {
|
|
|
777
778
|
/**
|
|
778
779
|
* Export specified image data in the buffer to a new browser window and use the browser's built-in print feature to print the image(s).
|
|
779
780
|
* @argument indices The indices of the converted images.
|
|
781
|
+
* @argument settings Configure the printing method.
|
|
780
782
|
*/
|
|
781
|
-
PrintEx(indices: number[]): boolean;
|
|
783
|
+
PrintEx(indices: number[], settings?: PrintSettings): boolean;
|
|
782
784
|
/**
|
|
783
785
|
* @deprecated since version 18.5. This property will be removed in future versions. Use asynchronous function `SaveAsBMP` instead.
|
|
784
786
|
* Save the specified image as a BMP file.
|
|
@@ -1195,3 +1197,7 @@ export interface MetaData{
|
|
|
1195
1197
|
resolutionX: number;
|
|
1196
1198
|
resolutionY: number;
|
|
1197
1199
|
}
|
|
1200
|
+
export interface PrintSettings{
|
|
1201
|
+
mode?: string; //'browser' | 'os'
|
|
1202
|
+
osPrintOptions?: { showPrintDialog?: boolean; };
|
|
1203
|
+
}
|
|
@@ -233,9 +233,9 @@ export interface DynamsoftViewer {
|
|
|
233
233
|
y: string; //Default is "center", values: "top", "bottom", "center"
|
|
234
234
|
}
|
|
235
235
|
/**
|
|
236
|
-
* Whether the viewer
|
|
236
|
+
* Whether the viewer displays the focus border after selecting with the Tab key. Default value: false.
|
|
237
237
|
*/
|
|
238
|
-
|
|
238
|
+
focusOutlineEnabled: boolean; // default value: false
|
|
239
239
|
/**
|
|
240
240
|
* [Scope] Main viewer
|
|
241
241
|
* [Description] Return the index of the next image of the currently selected image.
|
|
@@ -366,7 +366,7 @@ export interface DynamsoftViewer {
|
|
|
366
366
|
* [Description] Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
|
|
367
367
|
* @param element Specify an HTML element to create the viewer.
|
|
368
368
|
*/
|
|
369
|
-
bind(element: HTMLDivElement | HTMLElement): boolean;
|
|
369
|
+
bind(element: HTMLDivElement | HTMLElement | string): boolean;
|
|
370
370
|
/**
|
|
371
371
|
* [Scope] Main viewer
|
|
372
372
|
* [Description] Show the viewer (Main viewer, ImageEditor, ThumbnailViewer, CustomElement).
|
|
@@ -741,11 +741,11 @@ export interface ThumbnailViewer {
|
|
|
741
741
|
scrollDirection: string;
|
|
742
742
|
/**
|
|
743
743
|
* [Scope] Thumbnail viewer
|
|
744
|
-
* [Description] Set the
|
|
744
|
+
* [Description] Set the pageMargin between images & the margin between image and the viewer border). The default value is 10.
|
|
745
745
|
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
746
746
|
* number in pixels, string in percentage
|
|
747
747
|
*/
|
|
748
|
-
|
|
748
|
+
pageMargin: number | string;
|
|
749
749
|
/**
|
|
750
750
|
* [Scope] Thumbnail viewer
|
|
751
751
|
* [Description] Set the background of the entire thumbnail viewer. The default value is white.
|
|
@@ -816,14 +816,14 @@ export interface ThumbnailViewer {
|
|
|
816
816
|
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
817
817
|
* Allow any CSS rules
|
|
818
818
|
*/
|
|
819
|
-
|
|
819
|
+
hoverPageBackground: string;
|
|
820
820
|
/**
|
|
821
821
|
* [Scope] Thumbnail viewer
|
|
822
822
|
* [Description] Set the image border when the mouse is hovered.
|
|
823
823
|
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
824
824
|
* Allow any CSS rules
|
|
825
825
|
*/
|
|
826
|
-
|
|
826
|
+
hoverPageBorder: string;
|
|
827
827
|
/**
|
|
828
828
|
* [Scope] Thumbnail viewer
|
|
829
829
|
* [Description] Set the background when dragging the image. The default value is yellow.
|
|
@@ -837,14 +837,14 @@ export interface ThumbnailViewer {
|
|
|
837
837
|
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
838
838
|
* Allow any CSS rules
|
|
839
839
|
*/
|
|
840
|
-
|
|
840
|
+
selectedPageBorder: string;
|
|
841
841
|
/**
|
|
842
842
|
* [Scope] Thumbnail viewer
|
|
843
843
|
* [Description] Set the background of the selected image.
|
|
844
844
|
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
845
845
|
* Allow any CSS rules
|
|
846
846
|
*/
|
|
847
|
-
|
|
847
|
+
selectedPageBackground: string;
|
|
848
848
|
}
|
|
849
849
|
export interface DocumentEditor {
|
|
850
850
|
/**
|
package/dist/types/WebTwain.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { WebTwainViewer } from "./WebTwain.Viewer";
|
|
|
3
3
|
import { BarcodeReader } from "./Addon.BarcodeReader";
|
|
4
4
|
import { OCR } from "./Addon.OCR";
|
|
5
5
|
import { OCRPro } from "./Addon.OCRPro";
|
|
6
|
+
import { OCRKit } from "./Addon.OCRKit";
|
|
6
7
|
import { PDF } from "./Addon.PDF";
|
|
7
8
|
import { Webcam } from "./Addon.Webcam";
|
|
8
9
|
|
|
@@ -50,6 +51,7 @@ export interface Addon {
|
|
|
50
51
|
BarcodeReader: BarcodeReader;
|
|
51
52
|
OCR: OCR;
|
|
52
53
|
OCRPro: OCRPro;
|
|
54
|
+
OCRKit: OCRKit;
|
|
53
55
|
PDF: PDF;
|
|
54
56
|
Webcam: Webcam;
|
|
55
57
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
// Project: https://www.dynamsoft.com/products/webtwain_overview.aspx
|
|
2
|
-
// Definitions by: Xiao Ling <https://github.com/yushulx>
|
|
3
|
-
// Josh Hall <https://github.com/jbh>
|
|
4
|
-
// Lincoln Hu <https://github.com/lincoln2018>
|
|
5
|
-
// Tom Kent <https://github.com/Tom-Dynamsoft>
|
|
6
|
-
// Dave Sueltenfuss <https://github.com/dsueltenfuss>
|
|
7
2
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
8
3
|
// TypeScript Version: 3.1
|
|
9
4
|
|
|
@@ -13,7 +8,7 @@
|
|
|
13
8
|
*
|
|
14
9
|
* Copyright 2025, Dynamsoft Corporation
|
|
15
10
|
* Author: Dynamsoft Support Team
|
|
16
|
-
* Version: 19.
|
|
11
|
+
* Version: 19.2
|
|
17
12
|
*/
|
|
18
13
|
import Dynamsoft from "./Dynamsoft";
|
|
19
14
|
export default Dynamsoft;
|
package/dwt-openapi.yaml
CHANGED
|
@@ -4229,6 +4229,11 @@ components:
|
|
|
4229
4229
|
will be locked, if the scanner is a twain source, the source will be
|
|
4230
4230
|
opened automatically. Recommend to set it as false, avoid your
|
|
4231
4231
|
papers may be scanned by others.
|
|
4232
|
+
requestFocusForScanningUI:
|
|
4233
|
+
type: boolean
|
|
4234
|
+
default: true
|
|
4235
|
+
description: >-
|
|
4236
|
+
If true, the scanner UI will be brought to the top and get focus.
|
|
4232
4237
|
scannerFailureTimeout:
|
|
4233
4238
|
type: integer
|
|
4234
4239
|
format: int32
|