dwt 16.2.4 → 16.2.6
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 +16 -12
- package/dist/addon/dbrjs/dbr-7.6.0.full.wasm.js +4016 -4016
- package/dist/addon/dbrjs/dbr-7.6.0.worker.js +107 -107
- package/dist/addon/dbrjs/dbr.js +10 -10
- package/dist/dist/DynamsoftServiceSetup.deb +0 -0
- package/dist/dist/DynamsoftServiceSetup.msi +0 -0
- package/dist/dist/DynamsoftServiceSetup.pkg +0 -0
- package/dist/dist/DynamsoftServiceSetup.rpm +0 -0
- package/dist/dist/LICENSE +95 -95
- package/dist/dynamsoft.webtwain.min.js +209 -209
- package/dist/dynamsoft.webtwain.min.mjs +208 -208
- package/dist/src/dynamsoft.imageio_wasm-1.6.2.js +93 -93
- package/dist/src/dynamsoft.webtwain.css +1045 -1045
- package/dist/types/Addon.BarcodeReader.d.ts +168 -168
- package/dist/types/Addon.Camera.d.ts +125 -125
- package/dist/types/Addon.OCR.d.ts +264 -264
- package/dist/types/Addon.OCRPro.d.ts +251 -251
- package/dist/types/Addon.PDF.d.ts +110 -110
- package/dist/types/Addon.Webcam.d.ts +257 -257
- package/dist/types/Dynamsoft.Enum.d.ts +1850 -1849
- package/dist/types/Dynamsoft.FileUploader.d.ts +130 -130
- package/dist/types/Dynamsoft.d.ts +495 -495
- package/dist/types/WebTwain.Acquire.d.ts +1059 -1059
- package/dist/types/WebTwain.Buffer.d.ts +259 -259
- package/dist/types/WebTwain.Edit.d.ts +434 -434
- package/dist/types/WebTwain.IO.d.ts +951 -951
- package/dist/types/WebTwain.Util.d.ts +102 -102
- package/dist/types/WebTwain.Viewer.d.ts +795 -795
- package/dist/types/WebTwain.d.ts +51 -51
- package/dist/types/index.d.ts +20 -20
- package/package.json +2 -2
- package/samples/1.AcquireImage.html +0 -69
- package/samples/2.CustomScan.html +0 -98
- package/samples/3.PDFRasterizer.html +0 -73
- package/samples/4.OCRADocument.html +0 -156
- package/samples/5.ReadBarcode.html +0 -231
- package/samples/6.ScanOrCapture.html +0 -189
|
@@ -1,264 +1,264 @@
|
|
|
1
|
-
import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
|
|
2
|
-
|
|
3
|
-
export interface OCR {
|
|
4
|
-
/**
|
|
5
|
-
* Download and install the OCR add-on on the local system.
|
|
6
|
-
* @param path The URL to download the add-on (typically a ZIP file).
|
|
7
|
-
* @param successCallback A callback function that is executed if the request succeeds.
|
|
8
|
-
* @param failureCallback A callback function that is executed if the request fails.
|
|
9
|
-
* @argument errorCode The error code.
|
|
10
|
-
* @argument errorString The error string.
|
|
11
|
-
*/
|
|
12
|
-
Download(
|
|
13
|
-
path: string,
|
|
14
|
-
successCallback: () => void,
|
|
15
|
-
failureCallback: (
|
|
16
|
-
errorCode: number,
|
|
17
|
-
errorString: string
|
|
18
|
-
) => void
|
|
19
|
-
): void;
|
|
20
|
-
/**
|
|
21
|
-
* Return whether the OCR engine has been installed.
|
|
22
|
-
*/
|
|
23
|
-
IsModuleInstalled(): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Download and install an OCR language package.
|
|
26
|
-
* @param path The URL to download the package (typically a ZIP file).
|
|
27
|
-
* @param successCallback A callback function that is executed if the request succeeds.
|
|
28
|
-
* @param failureCallback A callback function that is executed if the request fails.
|
|
29
|
-
* @argument errorCode The error code.
|
|
30
|
-
* @argument errorString The error string.
|
|
31
|
-
*/
|
|
32
|
-
DownloadLangData(
|
|
33
|
-
path: string,
|
|
34
|
-
successCallback: () => void,
|
|
35
|
-
failureCallback: (
|
|
36
|
-
errorCode: number,
|
|
37
|
-
errorString: string
|
|
38
|
-
) => void
|
|
39
|
-
): void;
|
|
40
|
-
/**
|
|
41
|
-
* Return whether the output uses the fonts detected by the OCR system or the default/provided ones. Only valid when the result format is PDF.
|
|
42
|
-
*/
|
|
43
|
-
GetIfUseDetectedFont(): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Set whether the output uses the fonts detected by the OCR system or the default/provided ones. Only valid when the result format is PDF.
|
|
46
|
-
* @param value Whether to use or not the detected font.
|
|
47
|
-
*/
|
|
48
|
-
SetIfUseDetectedFont(value: boolean): boolean;
|
|
49
|
-
/**
|
|
50
|
-
* Return the font size base to apply higher-level regional accurate OCR.
|
|
51
|
-
*/
|
|
52
|
-
GetMinFontSizeforMoreAccurateResult(): number;
|
|
53
|
-
/**
|
|
54
|
-
* Set the font size base to apply higher-level regional accurate OCR.
|
|
55
|
-
* @param size Specify the size.
|
|
56
|
-
*/
|
|
57
|
-
SetMinFontSizeforMoreAccurateResult(size: number): number;
|
|
58
|
-
/**
|
|
59
|
-
* Return the font name for OCR. Only valid when the output format is PDF.
|
|
60
|
-
*/
|
|
61
|
-
GetUnicodeFontName(): string;
|
|
62
|
-
/**
|
|
63
|
-
* Set the font name for OCR. Only valid when the output format is PDF.
|
|
64
|
-
* @param name Specify a font to be used for the OCR.
|
|
65
|
-
*/
|
|
66
|
-
SetUnicodeFontName(name: string): boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Configure the OCR operation.
|
|
69
|
-
* @param language Specify the target language.
|
|
70
|
-
*/
|
|
71
|
-
SetLanguage(language: Dynamsoft.EnumDWT_OCRLanguage | string): boolean;
|
|
72
|
-
/**
|
|
73
|
-
* Configure the OCR operation.
|
|
74
|
-
* @param format Specify the output format.
|
|
75
|
-
*/
|
|
76
|
-
SetOutputFormat(format: Dynamsoft.EnumDWT_OCROutputFormat | number): boolean;
|
|
77
|
-
/**
|
|
78
|
-
* Configure the OCR operation.
|
|
79
|
-
* @param mode Specify the OCR page layout analysis mode.
|
|
80
|
-
*/
|
|
81
|
-
SetPageSetMode(mode: Dynamsoft.EnumDWT_OCRPageSetMode | number): boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Perform OCR on the specified image in the buffer.
|
|
84
|
-
* @param index Specify the image.
|
|
85
|
-
* @param successCallback A callback function that is executed if the request succeeds.
|
|
86
|
-
* @param failureCallback A callback function that is executed if the request fails.
|
|
87
|
-
* @argument imageId The imageId of the image which can be used to find the index.
|
|
88
|
-
* @argument result The OCR result.
|
|
89
|
-
* @argument errorCode The error code.
|
|
90
|
-
* @argument errorString The error string.
|
|
91
|
-
*/
|
|
92
|
-
Recognize(
|
|
93
|
-
index: number,
|
|
94
|
-
successCallback: (
|
|
95
|
-
imageId: number,
|
|
96
|
-
result: OCRResult
|
|
97
|
-
) => void,
|
|
98
|
-
failureCallback: (
|
|
99
|
-
errorCode: number,
|
|
100
|
-
errorString: string
|
|
101
|
-
) => void
|
|
102
|
-
): void;
|
|
103
|
-
/**
|
|
104
|
-
* Perform OCR on the specified local file.
|
|
105
|
-
* @param path Specify a local file.
|
|
106
|
-
* @param successCallback A callback function that is executed if the request succeeds.
|
|
107
|
-
* @param failureCallback A callback function that is executed if the request fails.
|
|
108
|
-
* @argument path The file path.
|
|
109
|
-
* @argument result The OCR result.
|
|
110
|
-
* @argument errorCode The error code.
|
|
111
|
-
* @argument errorString The error string.
|
|
112
|
-
*/
|
|
113
|
-
RecognizeFile(path: string,
|
|
114
|
-
successCallback: (
|
|
115
|
-
path: string,
|
|
116
|
-
result: OCRResult
|
|
117
|
-
) => void,
|
|
118
|
-
failureCallback: (
|
|
119
|
-
errorCode: number,
|
|
120
|
-
errorString: string
|
|
121
|
-
) => void
|
|
122
|
-
): void;
|
|
123
|
-
/**
|
|
124
|
-
* Perform OCR on the specified rectangular area on the image.
|
|
125
|
-
* @param index Specify the image.
|
|
126
|
-
* @param left Specify the rectangle (leftmost coordinate).
|
|
127
|
-
* @param top Specify the rectangle (topmost coordinate).
|
|
128
|
-
* @param right Specify the rectangle (rightmost coordinate).
|
|
129
|
-
* @param bottom Specify the rectangle (bottommost coordinate).
|
|
130
|
-
* @param successCallback A callback function that is executed if the request succeeds.
|
|
131
|
-
* @param failureCallback A callback function that is executed if the request fails.
|
|
132
|
-
* @argument imageId The imageId of the image which can be used to find the index.
|
|
133
|
-
* @argument result The OCR result.
|
|
134
|
-
* @argument errorCode The error code.
|
|
135
|
-
* @argument errorString The error string.
|
|
136
|
-
*/
|
|
137
|
-
RecognizeRect(
|
|
138
|
-
index: number,
|
|
139
|
-
left: number,
|
|
140
|
-
top: number,
|
|
141
|
-
right: number,
|
|
142
|
-
bottom: number,
|
|
143
|
-
successCallback: (
|
|
144
|
-
imageId: number,
|
|
145
|
-
left: number,
|
|
146
|
-
top: number,
|
|
147
|
-
right: number,
|
|
148
|
-
bottom: number,
|
|
149
|
-
result: OCRResult
|
|
150
|
-
) => void,
|
|
151
|
-
failureCallback: (
|
|
152
|
-
errorCode: number,
|
|
153
|
-
errorString: string
|
|
154
|
-
) => void
|
|
155
|
-
): void;
|
|
156
|
-
/**
|
|
157
|
-
* Perform OCR on the selected images in the buffer.
|
|
158
|
-
* @param index Specify the image.
|
|
159
|
-
* @param successCallback A callback function that is executed if the request succeeds.
|
|
160
|
-
* @param failureCallback A callback function that is executed if the request fails.
|
|
161
|
-
* @argument result The OCR result.
|
|
162
|
-
* @argument errorCode The error code.
|
|
163
|
-
* @argument errorString The error string.
|
|
164
|
-
*/
|
|
165
|
-
RecognizeSelectedImages(
|
|
166
|
-
successCallback: (
|
|
167
|
-
result: OCRResult
|
|
168
|
-
) => void,
|
|
169
|
-
failureCallback: (
|
|
170
|
-
errorCode: number,
|
|
171
|
-
errorString: string
|
|
172
|
-
) => void
|
|
173
|
-
): void;
|
|
174
|
-
}
|
|
175
|
-
export interface OCRResult {
|
|
176
|
-
/**
|
|
177
|
-
* Return a base64 string that contains the result of the OCR.
|
|
178
|
-
* Newlines are represented by the newline character: '\n'.
|
|
179
|
-
*/
|
|
180
|
-
Get(): string;
|
|
181
|
-
/**
|
|
182
|
-
* Return the error code.
|
|
183
|
-
*/
|
|
184
|
-
GetErrorCode(): number;
|
|
185
|
-
/**
|
|
186
|
-
* Return the error string.
|
|
187
|
-
*/
|
|
188
|
-
GetErrorString(): string;
|
|
189
|
-
/**
|
|
190
|
-
* Return the output format.
|
|
191
|
-
*/
|
|
192
|
-
GetFormat(): number;
|
|
193
|
-
/**
|
|
194
|
-
* Return the source information. It could be the index of the OCR'd image or the path of the OCR'd file.
|
|
195
|
-
*/
|
|
196
|
-
GetInput(): number | string;
|
|
197
|
-
/**
|
|
198
|
-
* Save the OCR result as a file.
|
|
199
|
-
* @param path The path to save the file.
|
|
200
|
-
*/
|
|
201
|
-
Save(path: string): boolean;
|
|
202
|
-
/**
|
|
203
|
-
* Return the number of pagesets in the OCR result.
|
|
204
|
-
*/
|
|
205
|
-
GetPageSetCount(): number;
|
|
206
|
-
/**
|
|
207
|
-
* Return the content of a pageset.
|
|
208
|
-
* @param index Specify the pageset
|
|
209
|
-
*/
|
|
210
|
-
GetPageSetContent(index: number): PageSet;
|
|
211
|
-
}
|
|
212
|
-
export interface PageSet {
|
|
213
|
-
/**
|
|
214
|
-
* Return the number of pages in the pageset.
|
|
215
|
-
*/
|
|
216
|
-
GetPageCount(): number;
|
|
217
|
-
/**
|
|
218
|
-
* Return the content of the specified page.
|
|
219
|
-
* @index Specify the page.
|
|
220
|
-
*/
|
|
221
|
-
GetPageContent(index: number): Page;
|
|
222
|
-
}
|
|
223
|
-
export interface Page {
|
|
224
|
-
/**
|
|
225
|
-
* Return the number of lines in the page.
|
|
226
|
-
*/
|
|
227
|
-
GetLineCount(): number;
|
|
228
|
-
/**
|
|
229
|
-
* Return the content of the specified line.
|
|
230
|
-
* @index Specify the line.
|
|
231
|
-
*/
|
|
232
|
-
GetLineContent(index: number): Line;
|
|
233
|
-
}
|
|
234
|
-
export interface Line {
|
|
235
|
-
/**
|
|
236
|
-
* Return the number of words in the line.
|
|
237
|
-
*/
|
|
238
|
-
GetWordCount(): number;
|
|
239
|
-
/**
|
|
240
|
-
* Return the coordinates for the rectangle that contains the specified line. The coordinates are in the sequence of "left,top,right,bottom" like "121,125,892,143".
|
|
241
|
-
*/
|
|
242
|
-
GetLineRect(): string;
|
|
243
|
-
/**
|
|
244
|
-
* Return the content of the specified word.
|
|
245
|
-
* @index Specify the word.
|
|
246
|
-
*/
|
|
247
|
-
GetWordContent(index: number): Word;
|
|
248
|
-
}
|
|
249
|
-
export interface Word {
|
|
250
|
-
/**
|
|
251
|
-
* Return the font name/size of the word.
|
|
252
|
-
*/
|
|
253
|
-
GetFontName(): string;
|
|
254
|
-
GetFontSize(): number;
|
|
255
|
-
/**
|
|
256
|
-
* Return the text of the word.
|
|
257
|
-
*/
|
|
258
|
-
GetText(): string;
|
|
259
|
-
/**
|
|
260
|
-
* Return the coordinates for the rectangle that contains the specified word. The coordinates are in the sequence of "left,top,right,bottom" like "121,126,157,139".
|
|
261
|
-
* @index Specify the word.
|
|
262
|
-
*/
|
|
263
|
-
GetWordRect(index: number): string;
|
|
264
|
-
}
|
|
1
|
+
import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
|
|
2
|
+
|
|
3
|
+
export interface OCR {
|
|
4
|
+
/**
|
|
5
|
+
* Download and install the OCR add-on on the local system.
|
|
6
|
+
* @param path The URL to download the add-on (typically a ZIP file).
|
|
7
|
+
* @param successCallback A callback function that is executed if the request succeeds.
|
|
8
|
+
* @param failureCallback A callback function that is executed if the request fails.
|
|
9
|
+
* @argument errorCode The error code.
|
|
10
|
+
* @argument errorString The error string.
|
|
11
|
+
*/
|
|
12
|
+
Download(
|
|
13
|
+
path: string,
|
|
14
|
+
successCallback: () => void,
|
|
15
|
+
failureCallback: (
|
|
16
|
+
errorCode: number,
|
|
17
|
+
errorString: string
|
|
18
|
+
) => void
|
|
19
|
+
): void;
|
|
20
|
+
/**
|
|
21
|
+
* Return whether the OCR engine has been installed.
|
|
22
|
+
*/
|
|
23
|
+
IsModuleInstalled(): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Download and install an OCR language package.
|
|
26
|
+
* @param path The URL to download the package (typically a ZIP file).
|
|
27
|
+
* @param successCallback A callback function that is executed if the request succeeds.
|
|
28
|
+
* @param failureCallback A callback function that is executed if the request fails.
|
|
29
|
+
* @argument errorCode The error code.
|
|
30
|
+
* @argument errorString The error string.
|
|
31
|
+
*/
|
|
32
|
+
DownloadLangData(
|
|
33
|
+
path: string,
|
|
34
|
+
successCallback: () => void,
|
|
35
|
+
failureCallback: (
|
|
36
|
+
errorCode: number,
|
|
37
|
+
errorString: string
|
|
38
|
+
) => void
|
|
39
|
+
): void;
|
|
40
|
+
/**
|
|
41
|
+
* Return whether the output uses the fonts detected by the OCR system or the default/provided ones. Only valid when the result format is PDF.
|
|
42
|
+
*/
|
|
43
|
+
GetIfUseDetectedFont(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Set whether the output uses the fonts detected by the OCR system or the default/provided ones. Only valid when the result format is PDF.
|
|
46
|
+
* @param value Whether to use or not the detected font.
|
|
47
|
+
*/
|
|
48
|
+
SetIfUseDetectedFont(value: boolean): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Return the font size base to apply higher-level regional accurate OCR.
|
|
51
|
+
*/
|
|
52
|
+
GetMinFontSizeforMoreAccurateResult(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Set the font size base to apply higher-level regional accurate OCR.
|
|
55
|
+
* @param size Specify the size.
|
|
56
|
+
*/
|
|
57
|
+
SetMinFontSizeforMoreAccurateResult(size: number): number;
|
|
58
|
+
/**
|
|
59
|
+
* Return the font name for OCR. Only valid when the output format is PDF.
|
|
60
|
+
*/
|
|
61
|
+
GetUnicodeFontName(): string;
|
|
62
|
+
/**
|
|
63
|
+
* Set the font name for OCR. Only valid when the output format is PDF.
|
|
64
|
+
* @param name Specify a font to be used for the OCR.
|
|
65
|
+
*/
|
|
66
|
+
SetUnicodeFontName(name: string): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Configure the OCR operation.
|
|
69
|
+
* @param language Specify the target language.
|
|
70
|
+
*/
|
|
71
|
+
SetLanguage(language: Dynamsoft.EnumDWT_OCRLanguage | string): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Configure the OCR operation.
|
|
74
|
+
* @param format Specify the output format.
|
|
75
|
+
*/
|
|
76
|
+
SetOutputFormat(format: Dynamsoft.EnumDWT_OCROutputFormat | number): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Configure the OCR operation.
|
|
79
|
+
* @param mode Specify the OCR page layout analysis mode.
|
|
80
|
+
*/
|
|
81
|
+
SetPageSetMode(mode: Dynamsoft.EnumDWT_OCRPageSetMode | number): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Perform OCR on the specified image in the buffer.
|
|
84
|
+
* @param index Specify the image.
|
|
85
|
+
* @param successCallback A callback function that is executed if the request succeeds.
|
|
86
|
+
* @param failureCallback A callback function that is executed if the request fails.
|
|
87
|
+
* @argument imageId The imageId of the image which can be used to find the index.
|
|
88
|
+
* @argument result The OCR result.
|
|
89
|
+
* @argument errorCode The error code.
|
|
90
|
+
* @argument errorString The error string.
|
|
91
|
+
*/
|
|
92
|
+
Recognize(
|
|
93
|
+
index: number,
|
|
94
|
+
successCallback: (
|
|
95
|
+
imageId: number,
|
|
96
|
+
result: OCRResult
|
|
97
|
+
) => void,
|
|
98
|
+
failureCallback: (
|
|
99
|
+
errorCode: number,
|
|
100
|
+
errorString: string
|
|
101
|
+
) => void
|
|
102
|
+
): void;
|
|
103
|
+
/**
|
|
104
|
+
* Perform OCR on the specified local file.
|
|
105
|
+
* @param path Specify a local file.
|
|
106
|
+
* @param successCallback A callback function that is executed if the request succeeds.
|
|
107
|
+
* @param failureCallback A callback function that is executed if the request fails.
|
|
108
|
+
* @argument path The file path.
|
|
109
|
+
* @argument result The OCR result.
|
|
110
|
+
* @argument errorCode The error code.
|
|
111
|
+
* @argument errorString The error string.
|
|
112
|
+
*/
|
|
113
|
+
RecognizeFile(path: string,
|
|
114
|
+
successCallback: (
|
|
115
|
+
path: string,
|
|
116
|
+
result: OCRResult
|
|
117
|
+
) => void,
|
|
118
|
+
failureCallback: (
|
|
119
|
+
errorCode: number,
|
|
120
|
+
errorString: string
|
|
121
|
+
) => void
|
|
122
|
+
): void;
|
|
123
|
+
/**
|
|
124
|
+
* Perform OCR on the specified rectangular area on the image.
|
|
125
|
+
* @param index Specify the image.
|
|
126
|
+
* @param left Specify the rectangle (leftmost coordinate).
|
|
127
|
+
* @param top Specify the rectangle (topmost coordinate).
|
|
128
|
+
* @param right Specify the rectangle (rightmost coordinate).
|
|
129
|
+
* @param bottom Specify the rectangle (bottommost coordinate).
|
|
130
|
+
* @param successCallback A callback function that is executed if the request succeeds.
|
|
131
|
+
* @param failureCallback A callback function that is executed if the request fails.
|
|
132
|
+
* @argument imageId The imageId of the image which can be used to find the index.
|
|
133
|
+
* @argument result The OCR result.
|
|
134
|
+
* @argument errorCode The error code.
|
|
135
|
+
* @argument errorString The error string.
|
|
136
|
+
*/
|
|
137
|
+
RecognizeRect(
|
|
138
|
+
index: number,
|
|
139
|
+
left: number,
|
|
140
|
+
top: number,
|
|
141
|
+
right: number,
|
|
142
|
+
bottom: number,
|
|
143
|
+
successCallback: (
|
|
144
|
+
imageId: number,
|
|
145
|
+
left: number,
|
|
146
|
+
top: number,
|
|
147
|
+
right: number,
|
|
148
|
+
bottom: number,
|
|
149
|
+
result: OCRResult
|
|
150
|
+
) => void,
|
|
151
|
+
failureCallback: (
|
|
152
|
+
errorCode: number,
|
|
153
|
+
errorString: string
|
|
154
|
+
) => void
|
|
155
|
+
): void;
|
|
156
|
+
/**
|
|
157
|
+
* Perform OCR on the selected images in the buffer.
|
|
158
|
+
* @param index Specify the image.
|
|
159
|
+
* @param successCallback A callback function that is executed if the request succeeds.
|
|
160
|
+
* @param failureCallback A callback function that is executed if the request fails.
|
|
161
|
+
* @argument result The OCR result.
|
|
162
|
+
* @argument errorCode The error code.
|
|
163
|
+
* @argument errorString The error string.
|
|
164
|
+
*/
|
|
165
|
+
RecognizeSelectedImages(
|
|
166
|
+
successCallback: (
|
|
167
|
+
result: OCRResult
|
|
168
|
+
) => void,
|
|
169
|
+
failureCallback: (
|
|
170
|
+
errorCode: number,
|
|
171
|
+
errorString: string
|
|
172
|
+
) => void
|
|
173
|
+
): void;
|
|
174
|
+
}
|
|
175
|
+
export interface OCRResult {
|
|
176
|
+
/**
|
|
177
|
+
* Return a base64 string that contains the result of the OCR.
|
|
178
|
+
* Newlines are represented by the newline character: '\n'.
|
|
179
|
+
*/
|
|
180
|
+
Get(): string;
|
|
181
|
+
/**
|
|
182
|
+
* Return the error code.
|
|
183
|
+
*/
|
|
184
|
+
GetErrorCode(): number;
|
|
185
|
+
/**
|
|
186
|
+
* Return the error string.
|
|
187
|
+
*/
|
|
188
|
+
GetErrorString(): string;
|
|
189
|
+
/**
|
|
190
|
+
* Return the output format.
|
|
191
|
+
*/
|
|
192
|
+
GetFormat(): number;
|
|
193
|
+
/**
|
|
194
|
+
* Return the source information. It could be the index of the OCR'd image or the path of the OCR'd file.
|
|
195
|
+
*/
|
|
196
|
+
GetInput(): number | string;
|
|
197
|
+
/**
|
|
198
|
+
* Save the OCR result as a file.
|
|
199
|
+
* @param path The path to save the file.
|
|
200
|
+
*/
|
|
201
|
+
Save(path: string): boolean;
|
|
202
|
+
/**
|
|
203
|
+
* Return the number of pagesets in the OCR result.
|
|
204
|
+
*/
|
|
205
|
+
GetPageSetCount(): number;
|
|
206
|
+
/**
|
|
207
|
+
* Return the content of a pageset.
|
|
208
|
+
* @param index Specify the pageset
|
|
209
|
+
*/
|
|
210
|
+
GetPageSetContent(index: number): PageSet;
|
|
211
|
+
}
|
|
212
|
+
export interface PageSet {
|
|
213
|
+
/**
|
|
214
|
+
* Return the number of pages in the pageset.
|
|
215
|
+
*/
|
|
216
|
+
GetPageCount(): number;
|
|
217
|
+
/**
|
|
218
|
+
* Return the content of the specified page.
|
|
219
|
+
* @index Specify the page.
|
|
220
|
+
*/
|
|
221
|
+
GetPageContent(index: number): Page;
|
|
222
|
+
}
|
|
223
|
+
export interface Page {
|
|
224
|
+
/**
|
|
225
|
+
* Return the number of lines in the page.
|
|
226
|
+
*/
|
|
227
|
+
GetLineCount(): number;
|
|
228
|
+
/**
|
|
229
|
+
* Return the content of the specified line.
|
|
230
|
+
* @index Specify the line.
|
|
231
|
+
*/
|
|
232
|
+
GetLineContent(index: number): Line;
|
|
233
|
+
}
|
|
234
|
+
export interface Line {
|
|
235
|
+
/**
|
|
236
|
+
* Return the number of words in the line.
|
|
237
|
+
*/
|
|
238
|
+
GetWordCount(): number;
|
|
239
|
+
/**
|
|
240
|
+
* Return the coordinates for the rectangle that contains the specified line. The coordinates are in the sequence of "left,top,right,bottom" like "121,125,892,143".
|
|
241
|
+
*/
|
|
242
|
+
GetLineRect(): string;
|
|
243
|
+
/**
|
|
244
|
+
* Return the content of the specified word.
|
|
245
|
+
* @index Specify the word.
|
|
246
|
+
*/
|
|
247
|
+
GetWordContent(index: number): Word;
|
|
248
|
+
}
|
|
249
|
+
export interface Word {
|
|
250
|
+
/**
|
|
251
|
+
* Return the font name/size of the word.
|
|
252
|
+
*/
|
|
253
|
+
GetFontName(): string;
|
|
254
|
+
GetFontSize(): number;
|
|
255
|
+
/**
|
|
256
|
+
* Return the text of the word.
|
|
257
|
+
*/
|
|
258
|
+
GetText(): string;
|
|
259
|
+
/**
|
|
260
|
+
* Return the coordinates for the rectangle that contains the specified word. The coordinates are in the sequence of "left,top,right,bottom" like "121,126,157,139".
|
|
261
|
+
* @index Specify the word.
|
|
262
|
+
*/
|
|
263
|
+
GetWordRect(index: number): string;
|
|
264
|
+
}
|