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,795 +1,795 @@
|
|
|
1
|
-
import { WebTwainAcquire } from "./WebTwain.Acquire";
|
|
2
|
-
import { Resolution } from "./Addon.Camera";
|
|
3
|
-
|
|
4
|
-
export interface WebTwainViewer extends WebTwainAcquire {
|
|
5
|
-
/**
|
|
6
|
-
* Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
|
|
7
|
-
* @param elementId Specify an HTML element to create the viewer.
|
|
8
|
-
*/
|
|
9
|
-
BindViewer(
|
|
10
|
-
elementId: string
|
|
11
|
-
): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Unbind and destroy the viewer.
|
|
14
|
-
*/
|
|
15
|
-
UnbindViewer(): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Return or set the background colour of the viewer.
|
|
18
|
-
*/
|
|
19
|
-
BackgroundColor: number;
|
|
20
|
-
/**
|
|
21
|
-
* Return or set the border colour for selected image(s).
|
|
22
|
-
*/
|
|
23
|
-
SelectionImageBorderColor: number;
|
|
24
|
-
/**
|
|
25
|
-
* Return or set how the image is fit in the viewer.
|
|
26
|
-
*/
|
|
27
|
-
FitWindowType: number;
|
|
28
|
-
/**
|
|
29
|
-
* Return or set the border colour for selected image(s).
|
|
30
|
-
*/
|
|
31
|
-
IfFitWindow: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Return or set the height of the viewer.
|
|
34
|
-
*/
|
|
35
|
-
Height: number | string;
|
|
36
|
-
/**
|
|
37
|
-
* Return or set the width of the viewer.
|
|
38
|
-
*/
|
|
39
|
-
Width: number | string;
|
|
40
|
-
/**
|
|
41
|
-
* Return the horizontal coordinate of the mouse.
|
|
42
|
-
*/
|
|
43
|
-
readonly MouseX: number;
|
|
44
|
-
/**
|
|
45
|
-
* Return the vertical coordinate of the mouse.
|
|
46
|
-
*/
|
|
47
|
-
readonly MouseY: number;
|
|
48
|
-
/**
|
|
49
|
-
* Return or set the shape of the cursor.
|
|
50
|
-
*/
|
|
51
|
-
MouseShape: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* Return or set whether the thumbnails view scrolls when new images come in.
|
|
54
|
-
*/
|
|
55
|
-
IfAutoScroll: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Return or set whether to show the page numbers.
|
|
58
|
-
*/
|
|
59
|
-
ShowPageNumber: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* Return or set the margin between images (in pixels).
|
|
62
|
-
*/
|
|
63
|
-
ImageMargin: number;
|
|
64
|
-
/**
|
|
65
|
-
* Return or set the zoom factor.
|
|
66
|
-
*/
|
|
67
|
-
Zoom: number;
|
|
68
|
-
Viewer: DynamsoftViewer;
|
|
69
|
-
}
|
|
70
|
-
export interface DynamsoftViewer {
|
|
71
|
-
/**
|
|
72
|
-
* Return or set the width of the viewer.
|
|
73
|
-
*/
|
|
74
|
-
width: number | string;
|
|
75
|
-
/**
|
|
76
|
-
* Return or set the height of the viewer.
|
|
77
|
-
*/
|
|
78
|
-
height: number | string;
|
|
79
|
-
/**
|
|
80
|
-
* Return the postfix of the main viewer.
|
|
81
|
-
*/
|
|
82
|
-
readonly idPostfix: string;
|
|
83
|
-
/**
|
|
84
|
-
* [Scope] Main viewer
|
|
85
|
-
* [Description] Return or set the background colour/image of the viewer.
|
|
86
|
-
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
87
|
-
* Replace the previous `BackgroundColor` method.
|
|
88
|
-
* Allow any CSS rules
|
|
89
|
-
*/
|
|
90
|
-
background: string;
|
|
91
|
-
/**
|
|
92
|
-
* [Scope] Global
|
|
93
|
-
* [Description] Return or set the border of the viewer.
|
|
94
|
-
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
95
|
-
* Allow any CSS rules
|
|
96
|
-
*/
|
|
97
|
-
border: string;
|
|
98
|
-
/**
|
|
99
|
-
* [Scope] Main viewer
|
|
100
|
-
* [Description] Return or set the border of the main viewer. Priority is higher than border.
|
|
101
|
-
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
102
|
-
* Allow any CSS rules
|
|
103
|
-
*/
|
|
104
|
-
innerBorder: string;
|
|
105
|
-
/**
|
|
106
|
-
* [Scope] Main viewer
|
|
107
|
-
* [Description] Return or set the shape of the cursor.
|
|
108
|
-
* [Usage Notes] The default value is crosshair, which supports drag to select an area on the image. When set to pointer, the shape is “hand”.
|
|
109
|
-
* Only works if the view mode of the viewer is set to -1 * -1, and the displayed image does not fit the Window (when there is a scroll bar), then the image can be moved.
|
|
110
|
-
* 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
111
|
-
* Replace the previous `MouseShape` property.
|
|
112
|
-
* Allow any CSS rules
|
|
113
|
-
*/
|
|
114
|
-
cursor: string;
|
|
115
|
-
/**
|
|
116
|
-
* [Scope] Main viewer
|
|
117
|
-
* [Description] Returns or sets whether to display the newly added image or keep the current one after an image(s) is imported into the Dynamic Web TWAIN viewer.
|
|
118
|
-
* The default value of the IfAutoScroll property is true. If set to true, it will display the newly added image. If set to false, it will display the current one.
|
|
119
|
-
* [Usage Notes] 'Invalid property type' is reported when the set value is not string or number.
|
|
120
|
-
*/
|
|
121
|
-
ifAutoScroll: boolean;
|
|
122
|
-
/**
|
|
123
|
-
* [Scope] Main viewer
|
|
124
|
-
* [Description] Return or set the margin between images in the main viewer.
|
|
125
|
-
* [Usage Notes] The pageMargin is only effective when the view mode is not -1 * -1.
|
|
126
|
-
* number in pixels, string in percentage.
|
|
127
|
-
*/
|
|
128
|
-
pageMargin: number | string;
|
|
129
|
-
/**
|
|
130
|
-
* [Scope] Main viewer
|
|
131
|
-
* [Description] Set the border color of the selected area.
|
|
132
|
-
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
133
|
-
* Allow any CSS rules
|
|
134
|
-
*/
|
|
135
|
-
selectedAreaBorderColor: string;
|
|
136
|
-
/**
|
|
137
|
-
* [Scope] Main viewer
|
|
138
|
-
* [Description] Specify a aspect ratio to be used when selecting a rectangle on an image. The default value is 0.
|
|
139
|
-
*/
|
|
140
|
-
selectionRectAspectRatio: number;
|
|
141
|
-
/**
|
|
142
|
-
* [Scope] Main viewer
|
|
143
|
-
* [Description] Return or set the zoom factor.
|
|
144
|
-
* [Usage Notes] Allow value [0.02 ~ 65].
|
|
145
|
-
*/
|
|
146
|
-
zoom: number;
|
|
147
|
-
/**
|
|
148
|
-
* [Scope] Main viewer
|
|
149
|
-
* [Description] Set whether to use single page mode.
|
|
150
|
-
* [Usage Notes] The default value is false, that is, the view mode is 1 * 1. True means the view mode is -1 * -1.
|
|
151
|
-
*/
|
|
152
|
-
singlePageMode: boolean;
|
|
153
|
-
/**
|
|
154
|
-
* [Scope] Main viewer, Thumbnail viewer
|
|
155
|
-
* [Description] Set whether to disable the ability to drag and drop image to the viewer. The default value is true.
|
|
156
|
-
* [Usage Notes] 'Unsupported file type' will be reported if the file is in an unsupported type.
|
|
157
|
-
*/
|
|
158
|
-
acceptDrop: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* [Scope] Main viewer
|
|
161
|
-
* [Description] Whether to allow sliding. The default value is true which supports swiping left and right to switch images.
|
|
162
|
-
* [Usage Notes] Only works if the view mode of the viewer is set to -1 * -1.
|
|
163
|
-
*/
|
|
164
|
-
allowSlide: boolean;
|
|
165
|
-
/**
|
|
166
|
-
* [Scope] Main viewer
|
|
167
|
-
* [Description] Return or set the border style for selected image(s).
|
|
168
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
169
|
-
* Allow any CSS rules
|
|
170
|
-
*/
|
|
171
|
-
selectedPageBorder: string;
|
|
172
|
-
/**
|
|
173
|
-
* [Scope] Main viewer
|
|
174
|
-
* [Description] Set the selected page background color of the viewer.
|
|
175
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
176
|
-
* Allow any CSS rules
|
|
177
|
-
*/
|
|
178
|
-
selectedPageBackground: string;
|
|
179
|
-
/**
|
|
180
|
-
* [Scope] Main viewer
|
|
181
|
-
* [Description] Whether to show the page number. The default value is false.
|
|
182
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
183
|
-
*/
|
|
184
|
-
showPageNumber: boolean;
|
|
185
|
-
/**
|
|
186
|
-
* [Scope] Main viewer
|
|
187
|
-
* [Description] Return the index of the next image of the currently selected image.
|
|
188
|
-
*/
|
|
189
|
-
next(): number;
|
|
190
|
-
/**
|
|
191
|
-
* [Scope] Main viewer
|
|
192
|
-
* [Description] Return the index of the previous image of the currently selected image.
|
|
193
|
-
*/
|
|
194
|
-
previous(): number;
|
|
195
|
-
/**
|
|
196
|
-
* [Scope] Main viewer
|
|
197
|
-
* [Description] Return the index of the fist image.
|
|
198
|
-
*/
|
|
199
|
-
first(): number;
|
|
200
|
-
/**
|
|
201
|
-
* [Scope] Main viewer
|
|
202
|
-
* [Description] Return the index of the last image.
|
|
203
|
-
*/
|
|
204
|
-
last(): number;
|
|
205
|
-
/**
|
|
206
|
-
* [Scope] Main viewer
|
|
207
|
-
* [Description] Go to the specified image.
|
|
208
|
-
*/
|
|
209
|
-
gotoPage(index: number): number;
|
|
210
|
-
/**
|
|
211
|
-
* [Scope] Main viewer
|
|
212
|
-
* [Description] Refresh the viewer, the effect is shown in "onPageRender" event
|
|
213
|
-
*/
|
|
214
|
-
render(): void;
|
|
215
|
-
/**
|
|
216
|
-
* [Scope] Global
|
|
217
|
-
* [Description] Create an image editor with specified settings.
|
|
218
|
-
* [Usage Notes] Replace the previous `ShowImageEditor` method. Only one ImageEditor object can be created.
|
|
219
|
-
* If you create it multiple times, you'll receive 'An ImageEditor already exists' error, and an existing ImageEditor object will be returned.
|
|
220
|
-
* @param editorSettings The ImageEditor settings. If not set, the default setting is used.
|
|
221
|
-
*/
|
|
222
|
-
createImageEditor(editorSettings?: EditorSettings): ImageEditor;
|
|
223
|
-
/**
|
|
224
|
-
* [Scope] Global
|
|
225
|
-
* [Description] Create a thumbnail viewer with specified settings.
|
|
226
|
-
* @param editorSettings The thumbnailViewerSettings settings. If not set, the default setting is used.
|
|
227
|
-
*/
|
|
228
|
-
createThumbnailViewer(thumbnailViewerSettings: ThumbnailViewerSettings): ThumbnailViewer;
|
|
229
|
-
/**
|
|
230
|
-
* [Scope] Main viewer
|
|
231
|
-
* [Description] Create a custom element and append it to the main viewer.
|
|
232
|
-
* @param element Specify an element (not ID).
|
|
233
|
-
* @param location Whether to put the element in the main viewer. Allowed values are left
|
|
234
|
-
* @param ifFull Whether to display the element in full screen.
|
|
235
|
-
*/
|
|
236
|
-
createCustomElement(element: HTMLDivElement, location?: string, ifFull?: boolean): CustomElement;
|
|
237
|
-
/**
|
|
238
|
-
* [Scope] Global
|
|
239
|
-
* [Description] Return the current UI settings (from DVS itself)
|
|
240
|
-
*/
|
|
241
|
-
getUISettings(): any;
|
|
242
|
-
/**
|
|
243
|
-
* [Scope] Global
|
|
244
|
-
* [Description] Reset UI settings to initial settings (JSON).
|
|
245
|
-
*/
|
|
246
|
-
resetUISetting(): any;
|
|
247
|
-
/**
|
|
248
|
-
* [Scope] Global
|
|
249
|
-
* [Description] Update UI settings and take effect immediately.
|
|
250
|
-
* @param uISettings Specify the updated settings.
|
|
251
|
-
*/
|
|
252
|
-
updateUISettings(uISettings: any): any;
|
|
253
|
-
/**
|
|
254
|
-
* [Scope] Main viewer
|
|
255
|
-
* [Description] Clear the selected area(s) on the current image.
|
|
256
|
-
*/
|
|
257
|
-
clearSelectedAreas(): void;
|
|
258
|
-
/**
|
|
259
|
-
* [Scope] Main viewer
|
|
260
|
-
* [Description] Set one or more rectangular area(s) on the specified image.
|
|
261
|
-
* @param areas Specify the areas.
|
|
262
|
-
*/
|
|
263
|
-
setSelectedAreas(areas: Area[]): void;
|
|
264
|
-
/**
|
|
265
|
-
* [Scope] Main viewer
|
|
266
|
-
* [Description] Fit the image to the window
|
|
267
|
-
* @param type Specify a type to fit. (width, height, both)
|
|
268
|
-
*/
|
|
269
|
-
fitWindow(type: string): void;
|
|
270
|
-
/**
|
|
271
|
-
* [Description] Set the CSS class name of the specified button defined in updateUISetting.
|
|
272
|
-
* @param name Specify the button.
|
|
273
|
-
* @param className Specify the CSS class name.
|
|
274
|
-
*/
|
|
275
|
-
setButtonClass(
|
|
276
|
-
name: string,
|
|
277
|
-
className: string
|
|
278
|
-
): boolean;
|
|
279
|
-
/**
|
|
280
|
-
* Set the view mode of the viewer.
|
|
281
|
-
* @param columns Specify the number of images per row.
|
|
282
|
-
* @param rows Specify the number of images per column.
|
|
283
|
-
*/
|
|
284
|
-
setViewMode(
|
|
285
|
-
columns: number,
|
|
286
|
-
rows: number
|
|
287
|
-
): boolean;
|
|
288
|
-
/**
|
|
289
|
-
* [Scope] Global
|
|
290
|
-
* [Description] Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
|
|
291
|
-
* @param element Specify an HTML element to create the viewer.
|
|
292
|
-
*/
|
|
293
|
-
bind(element: HTMLDivElement): boolean;
|
|
294
|
-
/**
|
|
295
|
-
* [Scope] Main viewer
|
|
296
|
-
* [Description] Show the viewer (Main viewer, ImageEditor, ThumbnailViewer, CustomElement).
|
|
297
|
-
*/
|
|
298
|
-
show(): void;
|
|
299
|
-
/**
|
|
300
|
-
* [Scope] Main viewer
|
|
301
|
-
* [Description] Hide the viewer(Main viewer, ImageEditor, ThumbnailViewer, CustomElement).
|
|
302
|
-
*/
|
|
303
|
-
hide(): void;
|
|
304
|
-
/**
|
|
305
|
-
* [Scope] Main viewer
|
|
306
|
-
* [Description] Unbind the viewer.
|
|
307
|
-
*/
|
|
308
|
-
unbind(): boolean;
|
|
309
|
-
/**
|
|
310
|
-
* [Scope] Main viewer
|
|
311
|
-
* [Description] Specify an event listener for the viewer event.
|
|
312
|
-
* @param name Specify the event name.
|
|
313
|
-
* @param callback The event listener
|
|
314
|
-
*/
|
|
315
|
-
on(name: string, callback: (event?: any, event1?: any, event2?: any) => void): void;
|
|
316
|
-
/**
|
|
317
|
-
* [Scope] Main viewer
|
|
318
|
-
* [Description] Remove the event handler.
|
|
319
|
-
* @param eventName Specify the event name.
|
|
320
|
-
* @param callback The event listener.
|
|
321
|
-
*/
|
|
322
|
-
off(eventName: string, callback?: () => void): void;
|
|
323
|
-
}
|
|
324
|
-
export interface EditorSettings {
|
|
325
|
-
/**
|
|
326
|
-
* [Scope] ImageEditor viewer
|
|
327
|
-
* [Scope] ImageEditor viewer
|
|
328
|
-
* [Description] Specify an HTML Element.
|
|
329
|
-
*/
|
|
330
|
-
element: HTMLDivElement;
|
|
331
|
-
/**
|
|
332
|
-
* [Scope] ImageEditor viewer
|
|
333
|
-
* [Description] The width of the image editor viewer. The default value is "100%".
|
|
334
|
-
* [Usage Notes] 'Invalid property value' will be reported when the set value is not string or number.
|
|
335
|
-
*/
|
|
336
|
-
width: number | string;
|
|
337
|
-
/**
|
|
338
|
-
* [Scope] ImageEditor viewer
|
|
339
|
-
* [Description] The height of the image editor viewer. The default value is "100%".
|
|
340
|
-
* [Usage Notes] 'Invalid property value' will be reported when the set value is not string or number.
|
|
341
|
-
*/
|
|
342
|
-
height: number | string;
|
|
343
|
-
/**
|
|
344
|
-
* [Scope] ImageEditor viewer
|
|
345
|
-
* [Description] The border of the ImageEditor viewer.
|
|
346
|
-
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
347
|
-
* Allow any CSS rules
|
|
348
|
-
*/
|
|
349
|
-
border: string;
|
|
350
|
-
/**
|
|
351
|
-
* [Scope] ImageEditor viewer
|
|
352
|
-
* [Description] Set the border of the top toolbar.
|
|
353
|
-
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
354
|
-
* Allow any CSS rules
|
|
355
|
-
*/
|
|
356
|
-
topMenuBorder: string;
|
|
357
|
-
/**
|
|
358
|
-
* [Scope] ImageEditor viewer
|
|
359
|
-
* [Description] The inner border of the image area.
|
|
360
|
-
* Allow any CSS rules
|
|
361
|
-
*/
|
|
362
|
-
innerBorder: string;
|
|
363
|
-
/**
|
|
364
|
-
* [Scope] ImageEditor viewer
|
|
365
|
-
* [Description] The background color/image of the ImageEditor viewer.
|
|
366
|
-
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
367
|
-
* Allow any CSS rules
|
|
368
|
-
*/
|
|
369
|
-
background: string;
|
|
370
|
-
/**
|
|
371
|
-
* [Scope] ImageEditor viewer
|
|
372
|
-
* [Description] Whether to pop up a window prompting to save the changes. The default value is true.
|
|
373
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
374
|
-
*/
|
|
375
|
-
promptToSaveChange: boolean;
|
|
376
|
-
/**
|
|
377
|
-
* [Scope] ImageEditor viewer
|
|
378
|
-
* [Description] Modify button titles and whether to hide specific buttons in the image editor viewer.
|
|
379
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
380
|
-
*/
|
|
381
|
-
buttons: {
|
|
382
|
-
titles: {
|
|
383
|
-
'previous': 'Previous Image',
|
|
384
|
-
'next': 'Next Image',
|
|
385
|
-
'print': 'Print Image',
|
|
386
|
-
'scan': 'Scan Documents',
|
|
387
|
-
'load': 'Load Local Images',
|
|
388
|
-
'rotateleft': 'Rotate Left',
|
|
389
|
-
'rotate': 'Rotate',
|
|
390
|
-
'rotateright': 'Rotate Right',
|
|
391
|
-
'deskew': 'Deskew',
|
|
392
|
-
'crop': 'Crop Selected Area',
|
|
393
|
-
'cut': 'Cut Selected Area',
|
|
394
|
-
'changeimagesize': 'Change Image Size',
|
|
395
|
-
'flip': 'Flip Image',
|
|
396
|
-
'mirror': 'Mirror Image',
|
|
397
|
-
'zoomin': 'Zoom In',
|
|
398
|
-
'originalsize': 'Show Original Size',
|
|
399
|
-
'zoomout': 'Zoom Out',
|
|
400
|
-
'stretch': 'Stretch Mode',
|
|
401
|
-
'fit': 'Fit Window',
|
|
402
|
-
'fitw': 'Fit Horizontally',
|
|
403
|
-
'fith': 'Fit Vertically',
|
|
404
|
-
'hand': 'Hand Mode',
|
|
405
|
-
'rectselect': 'Select Mode',
|
|
406
|
-
'zoom': 'Click to Zoom In',
|
|
407
|
-
'restore': 'Restore Original Image',
|
|
408
|
-
'save': 'Save Changes',
|
|
409
|
-
'close': 'Close the Editor',
|
|
410
|
-
'removeall': 'Remove All Images',
|
|
411
|
-
'removeselected': 'Remove All Selected Images'
|
|
412
|
-
},
|
|
413
|
-
visibility: {
|
|
414
|
-
'scan': true, 'load': true, 'print': true,
|
|
415
|
-
'removeall': true, 'removeselected': true,
|
|
416
|
-
'rotateleft': true, 'rotate': true, 'rotateright': true, 'deskew': true,
|
|
417
|
-
'crop': true, 'erase': true, 'changeimagesize': true, 'flip': true, 'mirror': true,
|
|
418
|
-
'zoomin': true, 'originalsize': true, 'zoomout': true, 'stretch': true,
|
|
419
|
-
'fit': true, 'fitw': true, 'fith': true,
|
|
420
|
-
'hand': true, 'rectselect': true, 'zoom': true, 'restore': true, 'save': true, 'close': true
|
|
421
|
-
}
|
|
422
|
-
};
|
|
423
|
-
/**
|
|
424
|
-
* [Scope] ImageEditor viewer
|
|
425
|
-
* [Description] Define the dialog text
|
|
426
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
427
|
-
*/
|
|
428
|
-
dialogText: {
|
|
429
|
-
dlgRotateAnyAngle: ['Angle :', 'Interpolation:', 'Keep size', ' OK ', 'Cancel'],
|
|
430
|
-
dlgChangeImageSize: ['New Height :', 'New Width :', 'Interpolation method:', ' OK ', 'Cancel'],
|
|
431
|
-
saveChangedImage: ['You have changed the image, do you want to keep the change(s)?', ' Yes ', ' No '],
|
|
432
|
-
selectSource: ['Select Source:', 'Select', 'Cancel', 'There is no source available']
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
export interface ThumbnailViewerSettings {
|
|
436
|
-
/**
|
|
437
|
-
* [Scope] Thumbnail viewer
|
|
438
|
-
* [Description] Where to put the thumbnail view. The allowed values are left, top, right, bottom. The default value is left.
|
|
439
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
440
|
-
*/
|
|
441
|
-
location: string;
|
|
442
|
-
/**
|
|
443
|
-
* [Scope] Thumbnail viewer
|
|
444
|
-
* [Description] Specify the size of width or height in pixels or percentage. The default value is 30%.
|
|
445
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
446
|
-
* number in pixels, string in percentage
|
|
447
|
-
*/
|
|
448
|
-
size: number | string;
|
|
449
|
-
/**
|
|
450
|
-
* [Scope] Thumbnail viewer
|
|
451
|
-
* [Description] Specify how many images to display per row.
|
|
452
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
453
|
-
* If columns and rows are both 1, report 'ThumbnailViewer shoud display more than 1 page' error.
|
|
454
|
-
* number in pixels, string in percentage
|
|
455
|
-
*/
|
|
456
|
-
columns: number;
|
|
457
|
-
/**
|
|
458
|
-
* [Scope] Thumbnail viewer
|
|
459
|
-
* [Description] Specify how many images to display per column.
|
|
460
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
461
|
-
* If columns and rows are both 1, report 'ThumbnailViewer shoud display more than 1 page' error.
|
|
462
|
-
* number in pixels, string in percentage
|
|
463
|
-
*/
|
|
464
|
-
rows: number;
|
|
465
|
-
/**
|
|
466
|
-
* [Scope] Thumbnail viewer
|
|
467
|
-
* [Description] Fit the image vertically or horizontally. Allowed values are 'vertical' and 'horizontal'.
|
|
468
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
469
|
-
*/
|
|
470
|
-
scrollDirection: string;
|
|
471
|
-
/**
|
|
472
|
-
* [Scope] Thumbnail viewer
|
|
473
|
-
* [Description] Set the margin between images & the margin between image and the viewer border). The default value is 10.
|
|
474
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
475
|
-
* number in pixels, string in percentage
|
|
476
|
-
*/
|
|
477
|
-
margin: number | string;
|
|
478
|
-
/**
|
|
479
|
-
* [Scope] Thumbnail viewer
|
|
480
|
-
* [Description] Set the background of the entire thumbnail viewer. The default value is white.
|
|
481
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
482
|
-
* Allow any CSS rules
|
|
483
|
-
*/
|
|
484
|
-
background: string;
|
|
485
|
-
/**
|
|
486
|
-
* [Scope] Thumbnail viewer
|
|
487
|
-
* [Description] Set the border of the thumbnail viewer.
|
|
488
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
489
|
-
* Allow any CSS rules
|
|
490
|
-
*/
|
|
491
|
-
border: string;
|
|
492
|
-
/**
|
|
493
|
-
* [Scope] Thumbnail viewer
|
|
494
|
-
* [Description] Whether to allow keyboard control.
|
|
495
|
-
*/
|
|
496
|
-
allowKeyboardControl: boolean;
|
|
497
|
-
/**
|
|
498
|
-
* [Scope] Thumbnail viewer
|
|
499
|
-
* [Description] Whether to allow image dragging. The default value is true.
|
|
500
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
501
|
-
*/
|
|
502
|
-
allowPageDragging: boolean;
|
|
503
|
-
/**
|
|
504
|
-
* [Scope] Thumbnail viewer
|
|
505
|
-
* [Description] Whether to allow the mouse to resize the thumbnail viewer. The default value is false.
|
|
506
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
507
|
-
*/
|
|
508
|
-
allowResizing: boolean;
|
|
509
|
-
/**
|
|
510
|
-
* [Scope] Thumbnail viewer
|
|
511
|
-
* [Description] Whether to show the page number. The default value is false.
|
|
512
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
513
|
-
*/
|
|
514
|
-
showPageNumber: boolean;
|
|
515
|
-
/**
|
|
516
|
-
* [Scope] Thumbnail viewer
|
|
517
|
-
* [Description] Return or set the background colour/image of the thumbnail viewer. The default value is white.
|
|
518
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
519
|
-
* Allow any CSS rules
|
|
520
|
-
*/
|
|
521
|
-
pageBackground: string;
|
|
522
|
-
/**
|
|
523
|
-
* [Scope] Thumbnail viewer
|
|
524
|
-
* [Description] Set the image border style.
|
|
525
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
526
|
-
* Allow any CSS rules
|
|
527
|
-
*/
|
|
528
|
-
pageBorder: string;
|
|
529
|
-
/**
|
|
530
|
-
* [Scope] Thumbnail viewer
|
|
531
|
-
* [Description] Set the image background when the mouse is hovered.
|
|
532
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
533
|
-
* Allow any CSS rules
|
|
534
|
-
*/
|
|
535
|
-
hoverBackground: string;
|
|
536
|
-
/**
|
|
537
|
-
* [Scope] Thumbnail viewer
|
|
538
|
-
* [Description] Set the image border when the mouse is hovered.
|
|
539
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
540
|
-
* Allow any CSS rules
|
|
541
|
-
*/
|
|
542
|
-
hoverBorder: string;
|
|
543
|
-
/**
|
|
544
|
-
* [Scope] Thumbnail viewer
|
|
545
|
-
* [Description] Set the background when dragging the image. The default value is yellow.
|
|
546
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
547
|
-
* Allow any CSS rules
|
|
548
|
-
*/
|
|
549
|
-
placeholderBackground: string;
|
|
550
|
-
/**
|
|
551
|
-
* [Scope] Thumbnail viewer
|
|
552
|
-
* [Description] Set the border of the selected image.
|
|
553
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
554
|
-
* Allow any CSS rules
|
|
555
|
-
*/
|
|
556
|
-
selectedImageBorder: string;
|
|
557
|
-
/**
|
|
558
|
-
* [Scope] Thumbnail viewer
|
|
559
|
-
* [Description] Set the background of the selected image.
|
|
560
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
561
|
-
* Allow any CSS rules
|
|
562
|
-
*/
|
|
563
|
-
selectedImageBackground: string;
|
|
564
|
-
}
|
|
565
|
-
export interface CustomElement {
|
|
566
|
-
/**
|
|
567
|
-
* [Scope] Current Element
|
|
568
|
-
* [Description] Show the element.
|
|
569
|
-
*/
|
|
570
|
-
show(): void;
|
|
571
|
-
/**
|
|
572
|
-
* [Scope] Current Element
|
|
573
|
-
* [Description] Hide the element.
|
|
574
|
-
*/
|
|
575
|
-
hide(): void;
|
|
576
|
-
/**
|
|
577
|
-
* [Scope] Current Element
|
|
578
|
-
* [Description] Delete the element.
|
|
579
|
-
*/
|
|
580
|
-
dispose(): void;
|
|
581
|
-
}
|
|
582
|
-
export interface ImageEditor {
|
|
583
|
-
/**
|
|
584
|
-
* [Scope] ImageEditor viewer
|
|
585
|
-
* [Description] Show the ImageEditor viewer.
|
|
586
|
-
*/
|
|
587
|
-
show(): void;
|
|
588
|
-
/**
|
|
589
|
-
* [Scope] ImageEditor viewer
|
|
590
|
-
* [Description] Hide the ImageEditor viewer.
|
|
591
|
-
*/
|
|
592
|
-
hide(): void;
|
|
593
|
-
/**
|
|
594
|
-
* [Scope] ImageEditor viewer
|
|
595
|
-
* [Description] Delete the ImageEditor viewer.
|
|
596
|
-
*/
|
|
597
|
-
dispose(): void;
|
|
598
|
-
}
|
|
599
|
-
export interface ThumbnailViewer {
|
|
600
|
-
/**
|
|
601
|
-
* [Scope] Thumbnail viewer
|
|
602
|
-
* [Description] Show the Thumbnail viewer.
|
|
603
|
-
*/
|
|
604
|
-
show(): void;
|
|
605
|
-
/**
|
|
606
|
-
* [Scope] Thumbnail viewer
|
|
607
|
-
* [Description] Hide the Thumbnail viewer.
|
|
608
|
-
*/
|
|
609
|
-
hide(): void;
|
|
610
|
-
/**
|
|
611
|
-
* [Scope] Thumbnail viewer
|
|
612
|
-
* [Description] Delete the Thumbnail viewer.
|
|
613
|
-
*/
|
|
614
|
-
dispose(): void;
|
|
615
|
-
/**
|
|
616
|
-
* [Scope] Thumbnail viewer
|
|
617
|
-
* [Description] Set the view mode.
|
|
618
|
-
*/
|
|
619
|
-
updateViewMode(viewMode: ViewMode): void;
|
|
620
|
-
/**
|
|
621
|
-
* [Scope] Thumbnail viewer
|
|
622
|
-
* [Description] Specify an event listener for the viewer event.
|
|
623
|
-
* @param name Specify the event name.
|
|
624
|
-
* @param callback The event listener.
|
|
625
|
-
*/
|
|
626
|
-
on(name: string, callback: (event?: any, event1?: any, event2?: any) => void): void;
|
|
627
|
-
/**
|
|
628
|
-
* [Scope] Thumbnail viewer
|
|
629
|
-
* [Description] Remove the event handler.
|
|
630
|
-
* @param eventName Specify the event name.
|
|
631
|
-
* @param callback The event listener.
|
|
632
|
-
*/
|
|
633
|
-
off(eventName: string, callback?: () => void): void;
|
|
634
|
-
/**
|
|
635
|
-
* [Scope] Thumbnail viewer
|
|
636
|
-
* [Description] Where to put the thumbnail view. The allowed values are left, top, right, bottom. The default value is left.
|
|
637
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
638
|
-
*/
|
|
639
|
-
location: string;
|
|
640
|
-
/**
|
|
641
|
-
* [Scope] Thumbnail viewer
|
|
642
|
-
* [Description] Specify the size of width or height in pixels or percentage. The default value is 30%.
|
|
643
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
644
|
-
* number in pixels, string in percentage
|
|
645
|
-
*/
|
|
646
|
-
size: number | string;
|
|
647
|
-
/**
|
|
648
|
-
* [Scope] Thumbnail viewer
|
|
649
|
-
* [Description] Specify scroll direction. Allowed values are 'vertical' and 'horizontal'.
|
|
650
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
651
|
-
*/
|
|
652
|
-
scrollDirection: string;
|
|
653
|
-
/**
|
|
654
|
-
* [Scope] Thumbnail viewer
|
|
655
|
-
* [Description] Set the margin between images & the margin between image and the viewer border). The default value is 10.
|
|
656
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
657
|
-
* number in pixels, string in percentage
|
|
658
|
-
*/
|
|
659
|
-
margin: number | string;
|
|
660
|
-
/**
|
|
661
|
-
* [Scope] Thumbnail viewer
|
|
662
|
-
* [Description] Set the background of the entire thumbnail viewer. The default value is white.
|
|
663
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
664
|
-
* Allow any CSS rules
|
|
665
|
-
*/
|
|
666
|
-
background: string;
|
|
667
|
-
/**
|
|
668
|
-
* [Scope] Thumbnail viewer
|
|
669
|
-
* [Description] Set the border of the thumbnail viewer.
|
|
670
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
671
|
-
* Allow any CSS rules
|
|
672
|
-
*/
|
|
673
|
-
border: string;
|
|
674
|
-
/**
|
|
675
|
-
* [Scope] Thumbnail viewer
|
|
676
|
-
* [Description] Whether to allow keyboard control.
|
|
677
|
-
*/
|
|
678
|
-
allowKeyboardControl: boolean;
|
|
679
|
-
/**
|
|
680
|
-
* [Scope] Thumbnail viewer
|
|
681
|
-
* [Description] Whether to allow image dragging. The default value is true.
|
|
682
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
683
|
-
*/
|
|
684
|
-
allowPageDragging: boolean;
|
|
685
|
-
/**
|
|
686
|
-
* [Scope] Thumbnail viewer
|
|
687
|
-
* [Description] Whether to allow the mouse to resize the thumbnail viewer. The default value is false.
|
|
688
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
689
|
-
*/
|
|
690
|
-
allowResizing: boolean;
|
|
691
|
-
/**
|
|
692
|
-
* [Scope] Thumbnail viewer
|
|
693
|
-
* [Description] Whether to show the page number. The default value is false.
|
|
694
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
695
|
-
*/
|
|
696
|
-
showPageNumber: boolean;
|
|
697
|
-
/**
|
|
698
|
-
* [Scope] Thumbnail viewer
|
|
699
|
-
* [Description] Return or set the background colour/image of the thumbnail viewer. The default value is white.
|
|
700
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
701
|
-
* Allow any CSS rules
|
|
702
|
-
*/
|
|
703
|
-
pageBackground: string;
|
|
704
|
-
/**
|
|
705
|
-
* [Scope] Thumbnail viewer
|
|
706
|
-
* [Description] Set the border of the thumbnail viewer.
|
|
707
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
708
|
-
* Allow any CSS rules
|
|
709
|
-
*/
|
|
710
|
-
pageBorder: string;
|
|
711
|
-
/**
|
|
712
|
-
* [Scope] Thumbnail viewer
|
|
713
|
-
* [Description] Set the image background when the mouse is hovered.
|
|
714
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
715
|
-
* Allow any CSS rules
|
|
716
|
-
*/
|
|
717
|
-
hoverBackground: string;
|
|
718
|
-
/**
|
|
719
|
-
* [Scope] Thumbnail viewer
|
|
720
|
-
* [Description] Set the image border when the mouse is hovered.
|
|
721
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
722
|
-
* Allow any CSS rules
|
|
723
|
-
*/
|
|
724
|
-
hoverBorder: string;
|
|
725
|
-
/**
|
|
726
|
-
* [Scope] Thumbnail viewer
|
|
727
|
-
* [Description] Set the background when dragging the image. The default value is yellow.
|
|
728
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
729
|
-
* Allow any CSS rules
|
|
730
|
-
*/
|
|
731
|
-
placeholderBackground: string;
|
|
732
|
-
/**
|
|
733
|
-
* [Scope] Thumbnail viewer
|
|
734
|
-
* [Description] Set the border of the selected image.
|
|
735
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
736
|
-
* Allow any CSS rules
|
|
737
|
-
*/
|
|
738
|
-
selectedImageBorder: string;
|
|
739
|
-
/**
|
|
740
|
-
* [Scope] Thumbnail viewer
|
|
741
|
-
* [Description] Set the background of the selected image.
|
|
742
|
-
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
743
|
-
* Allow any CSS rules
|
|
744
|
-
*/
|
|
745
|
-
selectedImageBackground: string;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
export interface ViewMode {
|
|
749
|
-
columns: number;
|
|
750
|
-
rows: number;
|
|
751
|
-
scrollDirection: string;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
export interface ViewerEvent {
|
|
755
|
-
/**
|
|
756
|
-
* The index of the current image.
|
|
757
|
-
*/
|
|
758
|
-
index: number;
|
|
759
|
-
/**
|
|
760
|
-
* The x-coordinate of the upper-left corner of the image.
|
|
761
|
-
*/
|
|
762
|
-
imageX: number;
|
|
763
|
-
/**
|
|
764
|
-
* The y-coordinate of the upper-left corner of the image.
|
|
765
|
-
*/
|
|
766
|
-
imageY: number;
|
|
767
|
-
/**
|
|
768
|
-
* The x-coordinate relative to the browser page.
|
|
769
|
-
*/
|
|
770
|
-
pageX: number;
|
|
771
|
-
/**
|
|
772
|
-
* The y-coordinate relative to the browser page.
|
|
773
|
-
*/
|
|
774
|
-
pageY: number;
|
|
775
|
-
}
|
|
776
|
-
export interface ThumbnailViewerEvent {
|
|
777
|
-
/**
|
|
778
|
-
* The index of the current image.
|
|
779
|
-
*/
|
|
780
|
-
index: number;
|
|
781
|
-
/**
|
|
782
|
-
* The x-coordinate relative to the browser page.
|
|
783
|
-
*/
|
|
784
|
-
pageX: number;
|
|
785
|
-
/**
|
|
786
|
-
* The y-coordinate relative to the browser page.
|
|
787
|
-
*/
|
|
788
|
-
pageY: number;
|
|
789
|
-
}
|
|
790
|
-
export interface Area {
|
|
791
|
-
left: number;
|
|
792
|
-
top: number;
|
|
793
|
-
right: number;
|
|
794
|
-
bottom: number;
|
|
795
|
-
}
|
|
1
|
+
import { WebTwainAcquire } from "./WebTwain.Acquire";
|
|
2
|
+
import { Resolution } from "./Addon.Camera";
|
|
3
|
+
|
|
4
|
+
export interface WebTwainViewer extends WebTwainAcquire {
|
|
5
|
+
/**
|
|
6
|
+
* Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
|
|
7
|
+
* @param elementId Specify an HTML element to create the viewer.
|
|
8
|
+
*/
|
|
9
|
+
BindViewer(
|
|
10
|
+
elementId: string
|
|
11
|
+
): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Unbind and destroy the viewer.
|
|
14
|
+
*/
|
|
15
|
+
UnbindViewer(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Return or set the background colour of the viewer.
|
|
18
|
+
*/
|
|
19
|
+
BackgroundColor: number;
|
|
20
|
+
/**
|
|
21
|
+
* Return or set the border colour for selected image(s).
|
|
22
|
+
*/
|
|
23
|
+
SelectionImageBorderColor: number;
|
|
24
|
+
/**
|
|
25
|
+
* Return or set how the image is fit in the viewer.
|
|
26
|
+
*/
|
|
27
|
+
FitWindowType: number;
|
|
28
|
+
/**
|
|
29
|
+
* Return or set the border colour for selected image(s).
|
|
30
|
+
*/
|
|
31
|
+
IfFitWindow: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Return or set the height of the viewer.
|
|
34
|
+
*/
|
|
35
|
+
Height: number | string;
|
|
36
|
+
/**
|
|
37
|
+
* Return or set the width of the viewer.
|
|
38
|
+
*/
|
|
39
|
+
Width: number | string;
|
|
40
|
+
/**
|
|
41
|
+
* Return the horizontal coordinate of the mouse.
|
|
42
|
+
*/
|
|
43
|
+
readonly MouseX: number;
|
|
44
|
+
/**
|
|
45
|
+
* Return the vertical coordinate of the mouse.
|
|
46
|
+
*/
|
|
47
|
+
readonly MouseY: number;
|
|
48
|
+
/**
|
|
49
|
+
* Return or set the shape of the cursor.
|
|
50
|
+
*/
|
|
51
|
+
MouseShape: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Return or set whether the thumbnails view scrolls when new images come in.
|
|
54
|
+
*/
|
|
55
|
+
IfAutoScroll: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Return or set whether to show the page numbers.
|
|
58
|
+
*/
|
|
59
|
+
ShowPageNumber: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Return or set the margin between images (in pixels).
|
|
62
|
+
*/
|
|
63
|
+
ImageMargin: number;
|
|
64
|
+
/**
|
|
65
|
+
* Return or set the zoom factor.
|
|
66
|
+
*/
|
|
67
|
+
Zoom: number;
|
|
68
|
+
Viewer: DynamsoftViewer;
|
|
69
|
+
}
|
|
70
|
+
export interface DynamsoftViewer {
|
|
71
|
+
/**
|
|
72
|
+
* Return or set the width of the viewer.
|
|
73
|
+
*/
|
|
74
|
+
width: number | string;
|
|
75
|
+
/**
|
|
76
|
+
* Return or set the height of the viewer.
|
|
77
|
+
*/
|
|
78
|
+
height: number | string;
|
|
79
|
+
/**
|
|
80
|
+
* Return the postfix of the main viewer.
|
|
81
|
+
*/
|
|
82
|
+
readonly idPostfix: string;
|
|
83
|
+
/**
|
|
84
|
+
* [Scope] Main viewer
|
|
85
|
+
* [Description] Return or set the background colour/image of the viewer.
|
|
86
|
+
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
87
|
+
* Replace the previous `BackgroundColor` method.
|
|
88
|
+
* Allow any CSS rules
|
|
89
|
+
*/
|
|
90
|
+
background: string;
|
|
91
|
+
/**
|
|
92
|
+
* [Scope] Global
|
|
93
|
+
* [Description] Return or set the border of the viewer.
|
|
94
|
+
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
95
|
+
* Allow any CSS rules
|
|
96
|
+
*/
|
|
97
|
+
border: string;
|
|
98
|
+
/**
|
|
99
|
+
* [Scope] Main viewer
|
|
100
|
+
* [Description] Return or set the border of the main viewer. Priority is higher than border.
|
|
101
|
+
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
102
|
+
* Allow any CSS rules
|
|
103
|
+
*/
|
|
104
|
+
innerBorder: string;
|
|
105
|
+
/**
|
|
106
|
+
* [Scope] Main viewer
|
|
107
|
+
* [Description] Return or set the shape of the cursor.
|
|
108
|
+
* [Usage Notes] The default value is crosshair, which supports drag to select an area on the image. When set to pointer, the shape is “hand”.
|
|
109
|
+
* Only works if the view mode of the viewer is set to -1 * -1, and the displayed image does not fit the Window (when there is a scroll bar), then the image can be moved.
|
|
110
|
+
* 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
111
|
+
* Replace the previous `MouseShape` property.
|
|
112
|
+
* Allow any CSS rules
|
|
113
|
+
*/
|
|
114
|
+
cursor: string;
|
|
115
|
+
/**
|
|
116
|
+
* [Scope] Main viewer
|
|
117
|
+
* [Description] Returns or sets whether to display the newly added image or keep the current one after an image(s) is imported into the Dynamic Web TWAIN viewer.
|
|
118
|
+
* The default value of the IfAutoScroll property is true. If set to true, it will display the newly added image. If set to false, it will display the current one.
|
|
119
|
+
* [Usage Notes] 'Invalid property type' is reported when the set value is not string or number.
|
|
120
|
+
*/
|
|
121
|
+
ifAutoScroll: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* [Scope] Main viewer
|
|
124
|
+
* [Description] Return or set the margin between images in the main viewer.
|
|
125
|
+
* [Usage Notes] The pageMargin is only effective when the view mode is not -1 * -1.
|
|
126
|
+
* number in pixels, string in percentage.
|
|
127
|
+
*/
|
|
128
|
+
pageMargin: number | string;
|
|
129
|
+
/**
|
|
130
|
+
* [Scope] Main viewer
|
|
131
|
+
* [Description] Set the border color of the selected area.
|
|
132
|
+
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
133
|
+
* Allow any CSS rules
|
|
134
|
+
*/
|
|
135
|
+
selectedAreaBorderColor: string;
|
|
136
|
+
/**
|
|
137
|
+
* [Scope] Main viewer
|
|
138
|
+
* [Description] Specify a aspect ratio to be used when selecting a rectangle on an image. The default value is 0.
|
|
139
|
+
*/
|
|
140
|
+
selectionRectAspectRatio: number;
|
|
141
|
+
/**
|
|
142
|
+
* [Scope] Main viewer
|
|
143
|
+
* [Description] Return or set the zoom factor.
|
|
144
|
+
* [Usage Notes] Allow value [0.02 ~ 65].
|
|
145
|
+
*/
|
|
146
|
+
zoom: number;
|
|
147
|
+
/**
|
|
148
|
+
* [Scope] Main viewer
|
|
149
|
+
* [Description] Set whether to use single page mode.
|
|
150
|
+
* [Usage Notes] The default value is false, that is, the view mode is 1 * 1. True means the view mode is -1 * -1.
|
|
151
|
+
*/
|
|
152
|
+
singlePageMode: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* [Scope] Main viewer, Thumbnail viewer
|
|
155
|
+
* [Description] Set whether to disable the ability to drag and drop image to the viewer. The default value is true.
|
|
156
|
+
* [Usage Notes] 'Unsupported file type' will be reported if the file is in an unsupported type.
|
|
157
|
+
*/
|
|
158
|
+
acceptDrop: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* [Scope] Main viewer
|
|
161
|
+
* [Description] Whether to allow sliding. The default value is true which supports swiping left and right to switch images.
|
|
162
|
+
* [Usage Notes] Only works if the view mode of the viewer is set to -1 * -1.
|
|
163
|
+
*/
|
|
164
|
+
allowSlide: boolean;
|
|
165
|
+
/**
|
|
166
|
+
* [Scope] Main viewer
|
|
167
|
+
* [Description] Return or set the border style for selected image(s).
|
|
168
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
169
|
+
* Allow any CSS rules
|
|
170
|
+
*/
|
|
171
|
+
selectedPageBorder: string;
|
|
172
|
+
/**
|
|
173
|
+
* [Scope] Main viewer
|
|
174
|
+
* [Description] Set the selected page background color of the viewer.
|
|
175
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
176
|
+
* Allow any CSS rules
|
|
177
|
+
*/
|
|
178
|
+
selectedPageBackground: string;
|
|
179
|
+
/**
|
|
180
|
+
* [Scope] Main viewer
|
|
181
|
+
* [Description] Whether to show the page number. The default value is false.
|
|
182
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
183
|
+
*/
|
|
184
|
+
showPageNumber: boolean;
|
|
185
|
+
/**
|
|
186
|
+
* [Scope] Main viewer
|
|
187
|
+
* [Description] Return the index of the next image of the currently selected image.
|
|
188
|
+
*/
|
|
189
|
+
next(): number;
|
|
190
|
+
/**
|
|
191
|
+
* [Scope] Main viewer
|
|
192
|
+
* [Description] Return the index of the previous image of the currently selected image.
|
|
193
|
+
*/
|
|
194
|
+
previous(): number;
|
|
195
|
+
/**
|
|
196
|
+
* [Scope] Main viewer
|
|
197
|
+
* [Description] Return the index of the fist image.
|
|
198
|
+
*/
|
|
199
|
+
first(): number;
|
|
200
|
+
/**
|
|
201
|
+
* [Scope] Main viewer
|
|
202
|
+
* [Description] Return the index of the last image.
|
|
203
|
+
*/
|
|
204
|
+
last(): number;
|
|
205
|
+
/**
|
|
206
|
+
* [Scope] Main viewer
|
|
207
|
+
* [Description] Go to the specified image.
|
|
208
|
+
*/
|
|
209
|
+
gotoPage(index: number): number;
|
|
210
|
+
/**
|
|
211
|
+
* [Scope] Main viewer
|
|
212
|
+
* [Description] Refresh the viewer, the effect is shown in "onPageRender" event
|
|
213
|
+
*/
|
|
214
|
+
render(): void;
|
|
215
|
+
/**
|
|
216
|
+
* [Scope] Global
|
|
217
|
+
* [Description] Create an image editor with specified settings.
|
|
218
|
+
* [Usage Notes] Replace the previous `ShowImageEditor` method. Only one ImageEditor object can be created.
|
|
219
|
+
* If you create it multiple times, you'll receive 'An ImageEditor already exists' error, and an existing ImageEditor object will be returned.
|
|
220
|
+
* @param editorSettings The ImageEditor settings. If not set, the default setting is used.
|
|
221
|
+
*/
|
|
222
|
+
createImageEditor(editorSettings?: EditorSettings): ImageEditor;
|
|
223
|
+
/**
|
|
224
|
+
* [Scope] Global
|
|
225
|
+
* [Description] Create a thumbnail viewer with specified settings.
|
|
226
|
+
* @param editorSettings The thumbnailViewerSettings settings. If not set, the default setting is used.
|
|
227
|
+
*/
|
|
228
|
+
createThumbnailViewer(thumbnailViewerSettings: ThumbnailViewerSettings): ThumbnailViewer;
|
|
229
|
+
/**
|
|
230
|
+
* [Scope] Main viewer
|
|
231
|
+
* [Description] Create a custom element and append it to the main viewer.
|
|
232
|
+
* @param element Specify an element (not ID).
|
|
233
|
+
* @param location Whether to put the element in the main viewer. Allowed values are "left" and "right".
|
|
234
|
+
* @param ifFull Whether to display the element in full screen.
|
|
235
|
+
*/
|
|
236
|
+
createCustomElement(element: HTMLDivElement, location?: string, ifFull?: boolean): CustomElement;
|
|
237
|
+
/**
|
|
238
|
+
* [Scope] Global
|
|
239
|
+
* [Description] Return the current UI settings (from DVS itself)
|
|
240
|
+
*/
|
|
241
|
+
getUISettings(): any;
|
|
242
|
+
/**
|
|
243
|
+
* [Scope] Global
|
|
244
|
+
* [Description] Reset UI settings to initial settings (JSON).
|
|
245
|
+
*/
|
|
246
|
+
resetUISetting(): any;
|
|
247
|
+
/**
|
|
248
|
+
* [Scope] Global
|
|
249
|
+
* [Description] Update UI settings and take effect immediately.
|
|
250
|
+
* @param uISettings Specify the updated settings.
|
|
251
|
+
*/
|
|
252
|
+
updateUISettings(uISettings: any): any;
|
|
253
|
+
/**
|
|
254
|
+
* [Scope] Main viewer
|
|
255
|
+
* [Description] Clear the selected area(s) on the current image.
|
|
256
|
+
*/
|
|
257
|
+
clearSelectedAreas(): void;
|
|
258
|
+
/**
|
|
259
|
+
* [Scope] Main viewer
|
|
260
|
+
* [Description] Set one or more rectangular area(s) on the specified image.
|
|
261
|
+
* @param areas Specify the areas.
|
|
262
|
+
*/
|
|
263
|
+
setSelectedAreas(areas: Area[]): void;
|
|
264
|
+
/**
|
|
265
|
+
* [Scope] Main viewer
|
|
266
|
+
* [Description] Fit the image to the window
|
|
267
|
+
* @param type Specify a type to fit. (width, height, both)
|
|
268
|
+
*/
|
|
269
|
+
fitWindow(type: string): void;
|
|
270
|
+
/**
|
|
271
|
+
* [Description] Set the CSS class name of the specified button defined in updateUISetting.
|
|
272
|
+
* @param name Specify the button.
|
|
273
|
+
* @param className Specify the CSS class name.
|
|
274
|
+
*/
|
|
275
|
+
setButtonClass(
|
|
276
|
+
name: string,
|
|
277
|
+
className: string
|
|
278
|
+
): boolean;
|
|
279
|
+
/**
|
|
280
|
+
* Set the view mode of the viewer.
|
|
281
|
+
* @param columns Specify the number of images per row.
|
|
282
|
+
* @param rows Specify the number of images per column.
|
|
283
|
+
*/
|
|
284
|
+
setViewMode(
|
|
285
|
+
columns: number,
|
|
286
|
+
rows: number
|
|
287
|
+
): boolean;
|
|
288
|
+
/**
|
|
289
|
+
* [Scope] Global
|
|
290
|
+
* [Description] Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
|
|
291
|
+
* @param element Specify an HTML element to create the viewer.
|
|
292
|
+
*/
|
|
293
|
+
bind(element: HTMLDivElement): boolean;
|
|
294
|
+
/**
|
|
295
|
+
* [Scope] Main viewer
|
|
296
|
+
* [Description] Show the viewer (Main viewer, ImageEditor, ThumbnailViewer, CustomElement).
|
|
297
|
+
*/
|
|
298
|
+
show(): void;
|
|
299
|
+
/**
|
|
300
|
+
* [Scope] Main viewer
|
|
301
|
+
* [Description] Hide the viewer(Main viewer, ImageEditor, ThumbnailViewer, CustomElement).
|
|
302
|
+
*/
|
|
303
|
+
hide(): void;
|
|
304
|
+
/**
|
|
305
|
+
* [Scope] Main viewer
|
|
306
|
+
* [Description] Unbind the viewer.
|
|
307
|
+
*/
|
|
308
|
+
unbind(): boolean;
|
|
309
|
+
/**
|
|
310
|
+
* [Scope] Main viewer
|
|
311
|
+
* [Description] Specify an event listener for the viewer event.
|
|
312
|
+
* @param name Specify the event name.
|
|
313
|
+
* @param callback The event listener
|
|
314
|
+
*/
|
|
315
|
+
on(name: string, callback: (event?: any, event1?: any, event2?: any) => void): void;
|
|
316
|
+
/**
|
|
317
|
+
* [Scope] Main viewer
|
|
318
|
+
* [Description] Remove the event handler.
|
|
319
|
+
* @param eventName Specify the event name.
|
|
320
|
+
* @param callback The event listener.
|
|
321
|
+
*/
|
|
322
|
+
off(eventName: string, callback?: () => void): void;
|
|
323
|
+
}
|
|
324
|
+
export interface EditorSettings {
|
|
325
|
+
/**
|
|
326
|
+
* [Scope] ImageEditor viewer
|
|
327
|
+
* [Scope] ImageEditor viewer
|
|
328
|
+
* [Description] Specify an HTML Element.
|
|
329
|
+
*/
|
|
330
|
+
element: HTMLDivElement;
|
|
331
|
+
/**
|
|
332
|
+
* [Scope] ImageEditor viewer
|
|
333
|
+
* [Description] The width of the image editor viewer. The default value is "100%".
|
|
334
|
+
* [Usage Notes] 'Invalid property value' will be reported when the set value is not string or number.
|
|
335
|
+
*/
|
|
336
|
+
width: number | string;
|
|
337
|
+
/**
|
|
338
|
+
* [Scope] ImageEditor viewer
|
|
339
|
+
* [Description] The height of the image editor viewer. The default value is "100%".
|
|
340
|
+
* [Usage Notes] 'Invalid property value' will be reported when the set value is not string or number.
|
|
341
|
+
*/
|
|
342
|
+
height: number | string;
|
|
343
|
+
/**
|
|
344
|
+
* [Scope] ImageEditor viewer
|
|
345
|
+
* [Description] The border of the ImageEditor viewer.
|
|
346
|
+
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
347
|
+
* Allow any CSS rules
|
|
348
|
+
*/
|
|
349
|
+
border: string;
|
|
350
|
+
/**
|
|
351
|
+
* [Scope] ImageEditor viewer
|
|
352
|
+
* [Description] Set the border of the top toolbar.
|
|
353
|
+
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
354
|
+
* Allow any CSS rules
|
|
355
|
+
*/
|
|
356
|
+
topMenuBorder: string;
|
|
357
|
+
/**
|
|
358
|
+
* [Scope] ImageEditor viewer
|
|
359
|
+
* [Description] The inner border of the image area.
|
|
360
|
+
* Allow any CSS rules
|
|
361
|
+
*/
|
|
362
|
+
innerBorder: string;
|
|
363
|
+
/**
|
|
364
|
+
* [Scope] ImageEditor viewer
|
|
365
|
+
* [Description] The background color/image of the ImageEditor viewer.
|
|
366
|
+
* [Usage Notes] 'Invalid property value' is reported when the set value does not meet the CSS standard.
|
|
367
|
+
* Allow any CSS rules
|
|
368
|
+
*/
|
|
369
|
+
background: string;
|
|
370
|
+
/**
|
|
371
|
+
* [Scope] ImageEditor viewer
|
|
372
|
+
* [Description] Whether to pop up a window prompting to save the changes. The default value is true.
|
|
373
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
374
|
+
*/
|
|
375
|
+
promptToSaveChange: boolean;
|
|
376
|
+
/**
|
|
377
|
+
* [Scope] ImageEditor viewer
|
|
378
|
+
* [Description] Modify button titles and whether to hide specific buttons in the image editor viewer.
|
|
379
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
380
|
+
*/
|
|
381
|
+
buttons: {
|
|
382
|
+
titles: {
|
|
383
|
+
'previous': 'Previous Image',
|
|
384
|
+
'next': 'Next Image',
|
|
385
|
+
'print': 'Print Image',
|
|
386
|
+
'scan': 'Scan Documents',
|
|
387
|
+
'load': 'Load Local Images',
|
|
388
|
+
'rotateleft': 'Rotate Left',
|
|
389
|
+
'rotate': 'Rotate',
|
|
390
|
+
'rotateright': 'Rotate Right',
|
|
391
|
+
'deskew': 'Deskew',
|
|
392
|
+
'crop': 'Crop Selected Area',
|
|
393
|
+
'cut': 'Cut Selected Area',
|
|
394
|
+
'changeimagesize': 'Change Image Size',
|
|
395
|
+
'flip': 'Flip Image',
|
|
396
|
+
'mirror': 'Mirror Image',
|
|
397
|
+
'zoomin': 'Zoom In',
|
|
398
|
+
'originalsize': 'Show Original Size',
|
|
399
|
+
'zoomout': 'Zoom Out',
|
|
400
|
+
'stretch': 'Stretch Mode',
|
|
401
|
+
'fit': 'Fit Window',
|
|
402
|
+
'fitw': 'Fit Horizontally',
|
|
403
|
+
'fith': 'Fit Vertically',
|
|
404
|
+
'hand': 'Hand Mode',
|
|
405
|
+
'rectselect': 'Select Mode',
|
|
406
|
+
'zoom': 'Click to Zoom In',
|
|
407
|
+
'restore': 'Restore Original Image',
|
|
408
|
+
'save': 'Save Changes',
|
|
409
|
+
'close': 'Close the Editor',
|
|
410
|
+
'removeall': 'Remove All Images',
|
|
411
|
+
'removeselected': 'Remove All Selected Images'
|
|
412
|
+
},
|
|
413
|
+
visibility: {
|
|
414
|
+
'scan': true, 'load': true, 'print': true,
|
|
415
|
+
'removeall': true, 'removeselected': true,
|
|
416
|
+
'rotateleft': true, 'rotate': true, 'rotateright': true, 'deskew': true,
|
|
417
|
+
'crop': true, 'erase': true, 'changeimagesize': true, 'flip': true, 'mirror': true,
|
|
418
|
+
'zoomin': true, 'originalsize': true, 'zoomout': true, 'stretch': true,
|
|
419
|
+
'fit': true, 'fitw': true, 'fith': true,
|
|
420
|
+
'hand': true, 'rectselect': true, 'zoom': true, 'restore': true, 'save': true, 'close': true
|
|
421
|
+
}
|
|
422
|
+
};
|
|
423
|
+
/**
|
|
424
|
+
* [Scope] ImageEditor viewer
|
|
425
|
+
* [Description] Define the dialog text
|
|
426
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
427
|
+
*/
|
|
428
|
+
dialogText: {
|
|
429
|
+
dlgRotateAnyAngle: ['Angle :', 'Interpolation:', 'Keep size', ' OK ', 'Cancel'],
|
|
430
|
+
dlgChangeImageSize: ['New Height :', 'New Width :', 'Interpolation method:', ' OK ', 'Cancel'],
|
|
431
|
+
saveChangedImage: ['You have changed the image, do you want to keep the change(s)?', ' Yes ', ' No '],
|
|
432
|
+
selectSource: ['Select Source:', 'Select', 'Cancel', 'There is no source available']
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
export interface ThumbnailViewerSettings {
|
|
436
|
+
/**
|
|
437
|
+
* [Scope] Thumbnail viewer
|
|
438
|
+
* [Description] Where to put the thumbnail view. The allowed values are left, top, right, bottom. The default value is left.
|
|
439
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
440
|
+
*/
|
|
441
|
+
location: string;
|
|
442
|
+
/**
|
|
443
|
+
* [Scope] Thumbnail viewer
|
|
444
|
+
* [Description] Specify the size of width or height in pixels or percentage. The default value is 30%.
|
|
445
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
446
|
+
* number in pixels, string in percentage
|
|
447
|
+
*/
|
|
448
|
+
size: number | string;
|
|
449
|
+
/**
|
|
450
|
+
* [Scope] Thumbnail viewer
|
|
451
|
+
* [Description] Specify how many images to display per row.
|
|
452
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
453
|
+
* If columns and rows are both 1, report 'ThumbnailViewer shoud display more than 1 page' error.
|
|
454
|
+
* number in pixels, string in percentage
|
|
455
|
+
*/
|
|
456
|
+
columns: number;
|
|
457
|
+
/**
|
|
458
|
+
* [Scope] Thumbnail viewer
|
|
459
|
+
* [Description] Specify how many images to display per column.
|
|
460
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
461
|
+
* If columns and rows are both 1, report 'ThumbnailViewer shoud display more than 1 page' error.
|
|
462
|
+
* number in pixels, string in percentage
|
|
463
|
+
*/
|
|
464
|
+
rows: number;
|
|
465
|
+
/**
|
|
466
|
+
* [Scope] Thumbnail viewer
|
|
467
|
+
* [Description] Fit the image vertically or horizontally. Allowed values are 'vertical' and 'horizontal'.
|
|
468
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
469
|
+
*/
|
|
470
|
+
scrollDirection: string;
|
|
471
|
+
/**
|
|
472
|
+
* [Scope] Thumbnail viewer
|
|
473
|
+
* [Description] Set the margin between images & the margin between image and the viewer border). The default value is 10.
|
|
474
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
475
|
+
* number in pixels, string in percentage
|
|
476
|
+
*/
|
|
477
|
+
margin: number | string;
|
|
478
|
+
/**
|
|
479
|
+
* [Scope] Thumbnail viewer
|
|
480
|
+
* [Description] Set the background of the entire thumbnail viewer. The default value is white.
|
|
481
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
482
|
+
* Allow any CSS rules
|
|
483
|
+
*/
|
|
484
|
+
background: string;
|
|
485
|
+
/**
|
|
486
|
+
* [Scope] Thumbnail viewer
|
|
487
|
+
* [Description] Set the border of the thumbnail viewer.
|
|
488
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
489
|
+
* Allow any CSS rules
|
|
490
|
+
*/
|
|
491
|
+
border: string;
|
|
492
|
+
/**
|
|
493
|
+
* [Scope] Thumbnail viewer
|
|
494
|
+
* [Description] Whether to allow keyboard control.
|
|
495
|
+
*/
|
|
496
|
+
allowKeyboardControl: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* [Scope] Thumbnail viewer
|
|
499
|
+
* [Description] Whether to allow image dragging. The default value is true.
|
|
500
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
501
|
+
*/
|
|
502
|
+
allowPageDragging: boolean;
|
|
503
|
+
/**
|
|
504
|
+
* [Scope] Thumbnail viewer
|
|
505
|
+
* [Description] Whether to allow the mouse to resize the thumbnail viewer. The default value is false.
|
|
506
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
507
|
+
*/
|
|
508
|
+
allowResizing: boolean;
|
|
509
|
+
/**
|
|
510
|
+
* [Scope] Thumbnail viewer
|
|
511
|
+
* [Description] Whether to show the page number. The default value is false.
|
|
512
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
513
|
+
*/
|
|
514
|
+
showPageNumber: boolean;
|
|
515
|
+
/**
|
|
516
|
+
* [Scope] Thumbnail viewer
|
|
517
|
+
* [Description] Return or set the background colour/image of the thumbnail viewer. The default value is white.
|
|
518
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
519
|
+
* Allow any CSS rules
|
|
520
|
+
*/
|
|
521
|
+
pageBackground: string;
|
|
522
|
+
/**
|
|
523
|
+
* [Scope] Thumbnail viewer
|
|
524
|
+
* [Description] Set the image border style.
|
|
525
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
526
|
+
* Allow any CSS rules
|
|
527
|
+
*/
|
|
528
|
+
pageBorder: string;
|
|
529
|
+
/**
|
|
530
|
+
* [Scope] Thumbnail viewer
|
|
531
|
+
* [Description] Set the image background when the mouse is hovered.
|
|
532
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
533
|
+
* Allow any CSS rules
|
|
534
|
+
*/
|
|
535
|
+
hoverBackground: string;
|
|
536
|
+
/**
|
|
537
|
+
* [Scope] Thumbnail viewer
|
|
538
|
+
* [Description] Set the image border when the mouse is hovered.
|
|
539
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
540
|
+
* Allow any CSS rules
|
|
541
|
+
*/
|
|
542
|
+
hoverBorder: string;
|
|
543
|
+
/**
|
|
544
|
+
* [Scope] Thumbnail viewer
|
|
545
|
+
* [Description] Set the background when dragging the image. The default value is yellow.
|
|
546
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
547
|
+
* Allow any CSS rules
|
|
548
|
+
*/
|
|
549
|
+
placeholderBackground: string;
|
|
550
|
+
/**
|
|
551
|
+
* [Scope] Thumbnail viewer
|
|
552
|
+
* [Description] Set the border of the selected image.
|
|
553
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
554
|
+
* Allow any CSS rules
|
|
555
|
+
*/
|
|
556
|
+
selectedImageBorder: string;
|
|
557
|
+
/**
|
|
558
|
+
* [Scope] Thumbnail viewer
|
|
559
|
+
* [Description] Set the background of the selected image.
|
|
560
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
561
|
+
* Allow any CSS rules
|
|
562
|
+
*/
|
|
563
|
+
selectedImageBackground: string;
|
|
564
|
+
}
|
|
565
|
+
export interface CustomElement {
|
|
566
|
+
/**
|
|
567
|
+
* [Scope] Current Element
|
|
568
|
+
* [Description] Show the element.
|
|
569
|
+
*/
|
|
570
|
+
show(): void;
|
|
571
|
+
/**
|
|
572
|
+
* [Scope] Current Element
|
|
573
|
+
* [Description] Hide the element.
|
|
574
|
+
*/
|
|
575
|
+
hide(): void;
|
|
576
|
+
/**
|
|
577
|
+
* [Scope] Current Element
|
|
578
|
+
* [Description] Delete the element.
|
|
579
|
+
*/
|
|
580
|
+
dispose(): void;
|
|
581
|
+
}
|
|
582
|
+
export interface ImageEditor {
|
|
583
|
+
/**
|
|
584
|
+
* [Scope] ImageEditor viewer
|
|
585
|
+
* [Description] Show the ImageEditor viewer.
|
|
586
|
+
*/
|
|
587
|
+
show(): void;
|
|
588
|
+
/**
|
|
589
|
+
* [Scope] ImageEditor viewer
|
|
590
|
+
* [Description] Hide the ImageEditor viewer.
|
|
591
|
+
*/
|
|
592
|
+
hide(): void;
|
|
593
|
+
/**
|
|
594
|
+
* [Scope] ImageEditor viewer
|
|
595
|
+
* [Description] Delete the ImageEditor viewer.
|
|
596
|
+
*/
|
|
597
|
+
dispose(): void;
|
|
598
|
+
}
|
|
599
|
+
export interface ThumbnailViewer {
|
|
600
|
+
/**
|
|
601
|
+
* [Scope] Thumbnail viewer
|
|
602
|
+
* [Description] Show the Thumbnail viewer.
|
|
603
|
+
*/
|
|
604
|
+
show(): void;
|
|
605
|
+
/**
|
|
606
|
+
* [Scope] Thumbnail viewer
|
|
607
|
+
* [Description] Hide the Thumbnail viewer.
|
|
608
|
+
*/
|
|
609
|
+
hide(): void;
|
|
610
|
+
/**
|
|
611
|
+
* [Scope] Thumbnail viewer
|
|
612
|
+
* [Description] Delete the Thumbnail viewer.
|
|
613
|
+
*/
|
|
614
|
+
dispose(): void;
|
|
615
|
+
/**
|
|
616
|
+
* [Scope] Thumbnail viewer
|
|
617
|
+
* [Description] Set the view mode.
|
|
618
|
+
*/
|
|
619
|
+
updateViewMode(viewMode: ViewMode): void;
|
|
620
|
+
/**
|
|
621
|
+
* [Scope] Thumbnail viewer
|
|
622
|
+
* [Description] Specify an event listener for the viewer event.
|
|
623
|
+
* @param name Specify the event name.
|
|
624
|
+
* @param callback The event listener.
|
|
625
|
+
*/
|
|
626
|
+
on(name: string, callback: (event?: any, event1?: any, event2?: any) => void): void;
|
|
627
|
+
/**
|
|
628
|
+
* [Scope] Thumbnail viewer
|
|
629
|
+
* [Description] Remove the event handler.
|
|
630
|
+
* @param eventName Specify the event name.
|
|
631
|
+
* @param callback The event listener.
|
|
632
|
+
*/
|
|
633
|
+
off(eventName: string, callback?: () => void): void;
|
|
634
|
+
/**
|
|
635
|
+
* [Scope] Thumbnail viewer
|
|
636
|
+
* [Description] Where to put the thumbnail view. The allowed values are left, top, right, bottom. The default value is left.
|
|
637
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
638
|
+
*/
|
|
639
|
+
location: string;
|
|
640
|
+
/**
|
|
641
|
+
* [Scope] Thumbnail viewer
|
|
642
|
+
* [Description] Specify the size of width or height in pixels or percentage. The default value is 30%.
|
|
643
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
644
|
+
* number in pixels, string in percentage
|
|
645
|
+
*/
|
|
646
|
+
size: number | string;
|
|
647
|
+
/**
|
|
648
|
+
* [Scope] Thumbnail viewer
|
|
649
|
+
* [Description] Specify scroll direction. Allowed values are 'vertical' and 'horizontal'.
|
|
650
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
651
|
+
*/
|
|
652
|
+
scrollDirection: string;
|
|
653
|
+
/**
|
|
654
|
+
* [Scope] Thumbnail viewer
|
|
655
|
+
* [Description] Set the margin between images & the margin between image and the viewer border). The default value is 10.
|
|
656
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
657
|
+
* number in pixels, string in percentage
|
|
658
|
+
*/
|
|
659
|
+
margin: number | string;
|
|
660
|
+
/**
|
|
661
|
+
* [Scope] Thumbnail viewer
|
|
662
|
+
* [Description] Set the background of the entire thumbnail viewer. The default value is white.
|
|
663
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
664
|
+
* Allow any CSS rules
|
|
665
|
+
*/
|
|
666
|
+
background: string;
|
|
667
|
+
/**
|
|
668
|
+
* [Scope] Thumbnail viewer
|
|
669
|
+
* [Description] Set the border of the thumbnail viewer.
|
|
670
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
671
|
+
* Allow any CSS rules
|
|
672
|
+
*/
|
|
673
|
+
border: string;
|
|
674
|
+
/**
|
|
675
|
+
* [Scope] Thumbnail viewer
|
|
676
|
+
* [Description] Whether to allow keyboard control.
|
|
677
|
+
*/
|
|
678
|
+
allowKeyboardControl: boolean;
|
|
679
|
+
/**
|
|
680
|
+
* [Scope] Thumbnail viewer
|
|
681
|
+
* [Description] Whether to allow image dragging. The default value is true.
|
|
682
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
683
|
+
*/
|
|
684
|
+
allowPageDragging: boolean;
|
|
685
|
+
/**
|
|
686
|
+
* [Scope] Thumbnail viewer
|
|
687
|
+
* [Description] Whether to allow the mouse to resize the thumbnail viewer. The default value is false.
|
|
688
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
689
|
+
*/
|
|
690
|
+
allowResizing: boolean;
|
|
691
|
+
/**
|
|
692
|
+
* [Scope] Thumbnail viewer
|
|
693
|
+
* [Description] Whether to show the page number. The default value is false.
|
|
694
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
695
|
+
*/
|
|
696
|
+
showPageNumber: boolean;
|
|
697
|
+
/**
|
|
698
|
+
* [Scope] Thumbnail viewer
|
|
699
|
+
* [Description] Return or set the background colour/image of the thumbnail viewer. The default value is white.
|
|
700
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
701
|
+
* Allow any CSS rules
|
|
702
|
+
*/
|
|
703
|
+
pageBackground: string;
|
|
704
|
+
/**
|
|
705
|
+
* [Scope] Thumbnail viewer
|
|
706
|
+
* [Description] Set the border of the thumbnail viewer.
|
|
707
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
708
|
+
* Allow any CSS rules
|
|
709
|
+
*/
|
|
710
|
+
pageBorder: string;
|
|
711
|
+
/**
|
|
712
|
+
* [Scope] Thumbnail viewer
|
|
713
|
+
* [Description] Set the image background when the mouse is hovered.
|
|
714
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
715
|
+
* Allow any CSS rules
|
|
716
|
+
*/
|
|
717
|
+
hoverBackground: string;
|
|
718
|
+
/**
|
|
719
|
+
* [Scope] Thumbnail viewer
|
|
720
|
+
* [Description] Set the image border when the mouse is hovered.
|
|
721
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
722
|
+
* Allow any CSS rules
|
|
723
|
+
*/
|
|
724
|
+
hoverBorder: string;
|
|
725
|
+
/**
|
|
726
|
+
* [Scope] Thumbnail viewer
|
|
727
|
+
* [Description] Set the background when dragging the image. The default value is yellow.
|
|
728
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
729
|
+
* Allow any CSS rules
|
|
730
|
+
*/
|
|
731
|
+
placeholderBackground: string;
|
|
732
|
+
/**
|
|
733
|
+
* [Scope] Thumbnail viewer
|
|
734
|
+
* [Description] Set the border of the selected image.
|
|
735
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
736
|
+
* Allow any CSS rules
|
|
737
|
+
*/
|
|
738
|
+
selectedImageBorder: string;
|
|
739
|
+
/**
|
|
740
|
+
* [Scope] Thumbnail viewer
|
|
741
|
+
* [Description] Set the background of the selected image.
|
|
742
|
+
* [Usage Notes] 'Invalid property value' will be reported when the specified value type is wrong or the parameter name is spelled incorrectly.
|
|
743
|
+
* Allow any CSS rules
|
|
744
|
+
*/
|
|
745
|
+
selectedImageBackground: string;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
export interface ViewMode {
|
|
749
|
+
columns: number;
|
|
750
|
+
rows: number;
|
|
751
|
+
scrollDirection: string;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
export interface ViewerEvent {
|
|
755
|
+
/**
|
|
756
|
+
* The index of the current image.
|
|
757
|
+
*/
|
|
758
|
+
index: number;
|
|
759
|
+
/**
|
|
760
|
+
* The x-coordinate of the upper-left corner of the image.
|
|
761
|
+
*/
|
|
762
|
+
imageX: number;
|
|
763
|
+
/**
|
|
764
|
+
* The y-coordinate of the upper-left corner of the image.
|
|
765
|
+
*/
|
|
766
|
+
imageY: number;
|
|
767
|
+
/**
|
|
768
|
+
* The x-coordinate relative to the browser page.
|
|
769
|
+
*/
|
|
770
|
+
pageX: number;
|
|
771
|
+
/**
|
|
772
|
+
* The y-coordinate relative to the browser page.
|
|
773
|
+
*/
|
|
774
|
+
pageY: number;
|
|
775
|
+
}
|
|
776
|
+
export interface ThumbnailViewerEvent {
|
|
777
|
+
/**
|
|
778
|
+
* The index of the current image.
|
|
779
|
+
*/
|
|
780
|
+
index: number;
|
|
781
|
+
/**
|
|
782
|
+
* The x-coordinate relative to the browser page.
|
|
783
|
+
*/
|
|
784
|
+
pageX: number;
|
|
785
|
+
/**
|
|
786
|
+
* The y-coordinate relative to the browser page.
|
|
787
|
+
*/
|
|
788
|
+
pageY: number;
|
|
789
|
+
}
|
|
790
|
+
export interface Area {
|
|
791
|
+
left: number;
|
|
792
|
+
top: number;
|
|
793
|
+
right: number;
|
|
794
|
+
bottom: number;
|
|
795
|
+
}
|