Skip to content

Commit 170b600

Browse files
authored
Merge pull request #594 from ztyyLV/Jackson-branch
Jackson branch
2 parents f34b5b6 + c760a5b commit 170b600

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

info/api/WebTwain_Acquire.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,22 @@ CloseSource(): boolean;
336336
</table>
337337
</div>
338338

339+
**Example**
340+
341+
```javascript
342+
// Close the scanner source in the success/failure callback after all images are acquired. In this case, the source can be freed and used by others.
343+
DWObject.OpenSource();
344+
DWObject.AcquireImage(successCallback,failureCallback);
345+
346+
function successCallback() {
347+
console.log("successful");
348+
}
349+
350+
function failureCallback(errorCode, errorString) {
351+
alert(errorString);
352+
}
353+
```
354+
339355
---
340356

341357
## CloseSourceAsync
@@ -539,6 +555,15 @@ OpenSource(): boolean;
539555
</table>
540556
</div>
541557

558+
**Example**
559+
560+
```javascript
561+
DWObject.GetSourceNames() // for example ['PaperStream IP fi-7300NX Net', 'TWAIN2 FreeImage Software Scanner']
562+
DWObject.SelectSourceByIndex(0); // choose scanner with the name "PaperStream IP fi-7300NX Net"
563+
DWObject.OpenSource();
564+
DWObject.AcquireImage();
565+
```
566+
542567
---
543568

544569
## OpenSourceAsync
@@ -666,6 +691,12 @@ interface Version {
666691
</table>
667692
</div>
668693

694+
**Example**
695+
696+
```javascript
697+
DWObject.GetSourceNames(); // return a list of scanner sources such as ['PaperStream IP fi-7300NX Net', 'TWAIN2 FreeImage Software Scanner']
698+
```
699+
669700
---
670701

671702
## GetSourceNamesAsync

0 commit comments

Comments
 (0)