You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: info/api/WebTwain_Acquire.md
+60-13Lines changed: 60 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1974,23 +1974,23 @@ Example argument for the parameter `fileName`
1974
1974
- "C:\\webtwain" + <> + ".jpg": The scanned images will result in "C:\\webtwain1.jpg", "C:\\webtwain2.jpg", "C:\\webtwain3.jpg", etc.
1975
1975
- "C:\\webtwain" + <%06d> + ".jpg": The scanned images will result in "C:\\webtwain000001.jpg", "C:\\webtwain000002.jpg", "C:\\webtwain000003.jpg", etc.
1976
1976
1977
-
Check out the available formats [Dynamsoft.DWT.EnumDWT_FileFormat]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_fileformat-).
1977
+
Check out the available formats [Dynamsoft.DWT.EnumDWT_FileFormat]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_fileformat).
if (DWObject.TransferMode===Dynamsoft.DWT.EnumDWT_TransferMode.TWSX_FILE) {
1985
-
if (
1986
-
DWObject.SetFileXferInfo(
1987
-
"C:\\Temp\\WebTWAIN<%06d>.bmp",
1988
-
Dynamsoft.DWT.EnumDWT_FileFormat.TWFF_BMP
1989
-
)
1990
-
) {
1991
-
DWObject.IfShowUI=true;
1992
-
DWObject.AcquireImage();
1993
-
}
1985
+
if (
1986
+
DWObject.SetFileXferInfo(
1987
+
"C:\\Temp\\WebTWAIN<%06d>.bmp",
1988
+
Dynamsoft.DWT.EnumDWT_FileFormat.TWFF_BMP
1989
+
)
1990
+
) {
1991
+
DWObject.IfShowUI=true;
1992
+
DWObject.AcquireImage();
1993
+
}
1994
1994
}
1995
1995
```
1996
1996
@@ -2154,6 +2154,8 @@ The value of this property defaults to `true` , which means that the newly acqui
2154
2154
2155
2155
If it's set to `false` , the images will be inserted before the current image. The important thing to note is that, by design, the current image is always the last acquired one which means that the images acquired after setting `IfAppendImage` to `false` will be displayed / retained in the reverse order.
2156
2156
2157
+
Here is an [article]({{site.faq}}insert-new-pages-to-existing-document.html#can-i-insert-newly-scanned-pages-to-an-existing-document) to demonstrate how to insert new images to a specified index.
@@ -2236,6 +2255,18 @@ Set this property after `OpenSource()` and before `AcquireImage()` .
2236
2255
2237
2256
Not all scanners support duplex scanning. To confirm, check the user manual of the device or check the value of `Duplex` after `OpenSource()` .
2238
2257
2258
+
**Example**
2259
+
2260
+
```javascript
2261
+
DWObject.OpenSource();
2262
+
2263
+
if (DWObject.Duplex!=0) { // Note: DWObject.Duplex doesn't support Linux.
2264
+
DWObject.IfDuplexEnabled=true;
2265
+
}
2266
+
2267
+
DWObject.AcquireImage();
2268
+
```
2269
+
2239
2270
---
2240
2271
2241
2272
## IfFeederEnabled
@@ -2278,6 +2309,14 @@ Set this property after `OpenSource()` and before `AcquireImage()` .
2278
2309
2279
2310
If the property is set to `true` , the data source will try acquiring images from the document feeder first. If the data source doesn't have a document feeder, the flatbed will be used.
2280
2311
2312
+
**Example**
2313
+
2314
+
```javascript
2315
+
DWObject.OpenSource();
2316
+
DWObject.IfFeederEnabled=true;
2317
+
DWObject.AcquireImage();
2318
+
```
2319
+
2281
2320
---
2282
2321
2283
2322
## IfShowUI
@@ -2317,7 +2356,15 @@ IfShowUI: boolean;
2317
2356
2318
2357
If the property is set to `true` , the data source will display its user interface when `AcquireImage()` is called. Otherwise, the UI will not be displayed and the scan will start immediately.
2319
2358
2320
-
It's recommended to use this API after OpenSource() is called.
2359
+
It's recommended to use this API after `OpenSource()` is called.
2360
+
2361
+
**Example**
2362
+
2363
+
```javascript
2364
+
DWObject.OpenSource();
2365
+
DWObject.IfShowUI=true; // display the scanner UI before acquiring image
* Unbind event listener(s) from the specified viewer event.
672
-
* @parameventName Specify the event.
673
-
* @paramcallback Specify the listener to remove
674
-
*/
675
-
off(eventName:string, callback?: () =>void):void;
676
-
/**
677
-
* Whether to allow keyboard control. Default: true.
678
-
*/
679
-
allowKeyboardControl:boolean;
680
-
/**
681
-
* Whether to allow page dragging to reorder the pages.
682
-
* Default: true.
683
-
*/
684
-
allowPageDragging:boolean;
685
-
/**
686
-
* Whether to allow resizing of the thumbnail viewer.
687
-
* Default: false.
688
-
*/
689
-
allowResizing:boolean;
690
-
/**
691
-
* Set or return the CSS rule for the background of the thumbnail viewer.
692
-
* Default: "rgb(255, 255, 255)".
693
-
*/
694
-
background:string;
695
-
/**
696
-
* Set or return the CSS rule for the border of the thumbnail viewer.
697
-
* Default: "".
698
-
*/
699
-
border:string;
700
-
/**
701
-
* Set or return the CSS rule for the background of the page the mouse hovers over in the thumbnail viewer.
702
-
* Default: "rgb(239, 246, 253)".
703
-
*/
704
-
hoverPageBackground:string;
705
-
/**
706
-
* Set or return the CSS rule for the border of the page the mouse hovers over in the thumbnail viewer.
707
-
* Default: "1px solid rgb(238, 238, 238)".
708
-
*/
709
-
hoverPageBorder:string;
710
-
/**
711
-
* Set or return the location of the thumbnail viewer. Allowed values are "left", "right", "top", "bottom".
712
-
* Default: "left".
713
-
*/
714
-
location:string;
715
-
/**
716
-
* Set or return the CSS rule for the background of a normal page in the thumbnail viewer.
717
-
* Default: "transparent".
718
-
*/
719
-
pageBackground:string;
720
-
/**
721
-
* Set or return the CSS rule for the border of a normal page in the thumbnail viewer.
722
-
* Default: "1px solid rgb(238, 238, 238)".
723
-
*/
724
-
pageBorder:string;
725
-
/**
726
-
* Set or return the margin between two adjacent images and the margin between an image and the border of the thumbnail viewer. The value can either be in pixels or percentage.
727
-
* Default: 10.
728
-
*/
729
-
pageMargin:number|string;
730
-
/**
731
-
* Set or return the CSS rule for the background of the placeholder which appears when you drag page(s) to reorder them in the thumbnail viewer.
732
-
* Default: "rgb(251, 236, 136)".
733
-
*/
734
-
placeholderBackground:string;
735
-
/**
736
-
* Set or return whether the pages are arranged vertically or horizontally.
737
-
* Default: "vertical". Allowed values are "vertical" and "horizontal".
738
-
*/
739
-
scrollDirection:string;
740
-
/**
741
-
* Set or return the CSS rule for the background of the selected page(s) in the thumbnail viewer.
742
-
* Default: "rgb(199, 222, 252)".
743
-
*/
744
-
selectedPageBackground:string;
745
-
/**
746
-
* Set or return the CSS rule for the border of the selected page(s) in the thumbnail viewer.
747
-
* Default: "1px solid rgb(125,162,206)".
748
-
*/
749
-
selectedPageBorder:string;
750
-
/**
751
-
* Set or return whether page numbers are shown.
752
-
* Default: false.
753
-
*/
754
-
showPageNumber:boolean;
755
-
/**
756
-
* Set or return the size of the thumbnail viewer. The value can either be in pixels or percentage (based on the width or height of the entire viewer).
757
-
* Default: "30%".
758
-
*/
759
-
size:number|string;
760
-
/**
761
-
* Set whether to select the index in the upper left corner of the viewer when scrolling.
762
-
* Default: false.
763
-
*/
764
-
autoChangeIndex:boolean;
765
-
/**
766
-
* Show checkbox on image(s).
767
-
*/
768
-
showCheckbox:boolean;
769
-
};
770
-
interfaceThumbnailViewerEvent {
771
-
// The index of the current page.
772
-
index:number;
773
-
// The x-coordinate of the browser page.
774
-
pageX:number;
775
-
// The y-coordinate of the browser page.
776
-
pageY:number;
777
-
};
778
-
interfaceViewMode {
779
-
/**
780
-
* Specify the number of images per row.
781
-
*/
782
-
columns:number;
783
-
/**
784
-
* Specify the number of images per column.
785
-
*/
786
-
rows:number;
787
-
/**
788
-
* Set or return whether the pages are arranged vertically or horizontally.
789
-
* Default: "vertical". Allowed values are "vertical" and "horizontal".
790
-
*/
791
-
scrollDirection:string;
792
-
}
793
-
```
794
626
627
+
**Parameters**
628
+
629
+
`thumbnailViewerSettings`: Configure the ThumbnailViewer object
0 commit comments