Skip to content

Commit 6845a85

Browse files
authored
Merge pull request #543 from dynamsoft-docs/preview
Preview
2 parents 3487659 + 62d2722 commit 6845a85

File tree

4 files changed

+13
-127
lines changed

4 files changed

+13
-127
lines changed

faq/how-to-exclude-wia-sources-in-the-source-list.md

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,12 @@ permalink: /faq/how-to-exclude-wia-sources-in-the-source-list.html
1515

1616
> Applicable to Windows only
1717
18-
There are two ways to achieve this:
1918

20-
* Set `IfUseTwainDSM` to `true`
2119

22-
``` javascript
23-
DWObject.IfUseTwainDSM = true;
24-
```
25-
26-
* Filter sources before listing them
20+
* Set [IfUseTwainDSM]({{site.info}}api/WebTwain_Acquire.html#ifusetwaindsm) to `true`
2721

2822
``` javascript
29-
var sources = DWObject.GetSourceNames();
30-
for (var i = 0; i < sources.length; i++) {
31-
if (sources[i].toLowerCase().indexOf('epson') != -1) {
32-
sources.splice(i, 1);
33-
}
34-
}
23+
DWObject.IfUseTwainDSM = true;
3524
```
3625

3726
If you are still having issues with a device, please feel free to [contact us](https://www.dynamsoft.com/company/contact/) via email, live chat, or phone call.

info/api/WebTwain_Buffer.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ The properties and methods on this page live in the namespace {WebTwainObject}.
2424
| [`ImageIDToIndex()`](#imageidtoindex) | [`IndexToImageID()`](#indextoimageid) | [`IsBlankImage()`](#isblankimage) | [`IsBlankImageExpress()`](#isblankimageexpress) |
2525
| [`SelectAllImages()`](#selectallimages) | [`MoveImage()`](#moveimage) | [`SwitchImage()`](#switchimage) | [`RemoveImage()`](#removeimage) |
2626
| [`RemoveAllImages()`](#removeallimages) | [`RemoveAllSelectedImages()`](#removeallselectedimages) | [`SelectImages()`](#selectimages) | [`GetTagListByIndex()`](#gettaglistbyindex) |
27+
| [`CreateDocument()`](#createdocument) | [`OpenDocument()`](#opendocument) | [`GetCurrentDocumentName()`](#getcurrentdocumentname) | [`RenameDocument()`](#renamedocument) |
28+
| [`RemoveDocument()`](#removedocument) | [`GetDocumentInfoList()`](#getdocumentinfolist) |
2729

2830

2931
<!--* [GetImageBitDepthAsync()](#getimagebitdepthasync)-->

info/api/WebTwain_Viewer.md

Lines changed: 7 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,8 @@ permalink: /info/api/WebTwain_Viewer.html
5252
/**
5353
* Create a Dynamsoft Viewer instance and bind it to the WebTwain instance.
5454
* @param element Specify an HTML element to create the viewer.
55-
* @param documentTemplate Specify the document template.
5655
*/
57-
bind(element: HTMLDivElement, documentTemplate: DocumentViewerTemplate) : void;
58-
59-
interface DocumentViewerTemplate{
60-
getCustomElement():CustomElement; //Get CustomElement. Can display save & upload interface in CustomElement.
61-
onAddDocumentFunc = function () {}
62-
onExitFunc = function () {}
63-
onSaveFunc = function () {} //Save button click event
64-
onUploadFunc = function () {} //Upload button click event
65-
onRemoveSelectedFunc = function () {} //Remove button click event
66-
}
56+
bind(element: HTMLDivElement | HTMLElement) : boolean;
6757
```
6858

6959
**Example**
@@ -73,20 +63,15 @@ var DWObject, template;
7363
Dynamsoft.DWT.CreateDWTObjectEx(
7464
{
7565
WebTwainId: "a",
76-
UseLocalService: false,
7766
},
7867
function (obj) {
7968
DWObject = obj;
80-
template = DWObject.Viewer.createTemplate("documentScanner");
81-
DWObject.Viewer.bind(null, template); //full screen
82-
DWObject.Viewer.show();
83-
84-
template.onExitFunc = function () {
85-
DWObject.Viewer.show();
86-
console.error ("execute");
87-
//RemoveAllFile();
88-
}
89-
}, function (errorCode, errorString) {
69+
template = DWObject.Viewer.getElementById("dwtcontrolContainer_temp3");
70+
DWObject.Viewer.width=500;
71+
    DWObject.Viewer.height=600;
72+
DWObject.Viewer.show();
73+
},
74+
function (errorCode, errorString) {
9075
console.log(errorString);
9176
});
9277
```
@@ -2433,96 +2418,6 @@ When set to true, the index in the upper left corner of the viewer will be selec
24332418

24342419
---
24352420

2436-
## createTemplate
2437-
2438-
**Syntax**
2439-
2440-
<div class="sample-code-prefix template2"></div>
2441-
>- v17.3
2442-
>- v17.2.5
2443-
>
2444-
>
2445-
```typescript
2446-
/**
2447-
* Create document scanner template.
2448-
* @argument templateName Currently templateName only supports "documentScanner".
2449-
* @argument documentConfiguration Configuration for the document object.
2450-
*/
2451-
createTemplate("templateName", documentConfiguration?: DocumentConfiguration):DocumentViewerTemplate
2452-
interface DocumentViewerTemplate{
2453-
getCustomElement():CustomElement; //Get CustomElement. Can display save & upload interface in CustomElement.
2454-
onAddDocumentFunc = function () {}
2455-
onExitFunc = function () {}
2456-
onSaveFunc = function () {} //Save button click event
2457-
onUploadFunc = function () {} //Upload button click event
2458-
onRemoveSelectedFunc = function () {} //Remove button click event
2459-
}
2460-
```
2461-
```typescript
2462-
/**
2463-
* Create document scanner template.
2464-
* @argument templateName Currently templateName only supports "documentScanner".
2465-
*/
2466-
createTemplate("templateName"):DocumentViewerTemplate
2467-
interface DocumentViewerTemplate{
2468-
getCustomElement():CustomElement; //Get CustomElement. Can display save & upload interface in CustomElement.
2469-
onAddDocumentFunc = function () {}
2470-
onExitFunc = function () {}
2471-
onSaveFunc = function () {} //Save button click event
2472-
onUploadFunc = function () {} //Upload button click event
2473-
onRemoveSelectedFunc = function () {} //Remove button click event
2474-
}
2475-
```
2476-
**Availability**
2477-
<div class="availability">
2478-
<table>
2479-
2480-
<tr>
2481-
<td align="center">ActiveX</td>
2482-
<td align="center">H5(Windows)</td>
2483-
<td align="center">H5(macOS/TWAIN)</td>
2484-
<td align="center">H5(macOS/ICA)</td>
2485-
<td align="center">H5(Linux)</td>
2486-
</tr>
2487-
2488-
<tr>
2489-
<td align="center">not supported </td>
2490-
<td align="center">v17.3+ </td>
2491-
<td align="center">v17.3+ </td>
2492-
<td align="center">v17.3+ </td>
2493-
<td align="center">v17.3+ </td>
2494-
</tr>
2495-
2496-
</table>
2497-
</div>
2498-
2499-
**Example**
2500-
2501-
```javascript
2502-
var DWObject, template;
2503-
Dynamsoft.DWT.CreateDWTObjectEx(
2504-
{
2505-
WebTwainId: "a",
2506-
UseLocalService: false,
2507-
},
2508-
function (obj) {
2509-
DWObject = obj;
2510-
template = DWObject.Viewer.createTemplate("documentScanner");
2511-
DWObject.Viewer.bind(null, template); //full screen
2512-
DWObject.Viewer.show();
2513-
2514-
template.onExitFunc = function () {
2515-
DWObject.Viewer.show();
2516-
console.error ("execute");
2517-
//RemoveAllFile();
2518-
}
2519-
}, function (errorCode, errorString) {
2520-
console.log(errorString);
2521-
});
2522-
```
2523-
2524-
---
2525-
25262421
## updateCheckboxStyle
25272422

25282423
**Syntax**

info/api/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ permalink: /info/api/
3737
|[`SelectAllImages()`]({{site.info}}api/WebTwain_Buffer.html#selectallimages)|[`MoveImage()`]({{site.info}}api/WebTwain_Buffer.html#moveimage) | [`SwitchImage()`]({{site.info}}api/WebTwain_Buffer.html#switchimage)| [`RemoveImage()`]({{site.info}}api/WebTwain_Buffer.html#removeimage) |
3838
| [`RemoveAllImages()`]({{site.info}}api/WebTwain_Buffer.html#removeallimages)|[`RemoveAllSelectedImages()`]({{site.info}}api/WebTwain_Buffer.html#removeallselectedimages) |[`SelectImages()`]({{site.info}}api/WebTwain_Buffer.html#selectimages)|[`GetTagListByIndex()`]({{site.info}}api/WebTwain_Buffer.html#gettaglistbyindex) |
3939
| [`CreateDocument()`]({{site.info}}api/WebTwain_Buffer.html#createdocument)|[`OpenDocument()`]({{site.info}}api/WebTwain_Buffer.html#opendocument)|[`GetCurrentDocumentName()`]({{site.info}}api/WebTwain_Buffer.html#getcurrentdocumentname)|[`RenameDocument()`]({{site.info}}api/WebTwain_Buffer.html#renamedocument)|
40-
|[`RemoveDocument()`]({{site.info}}api/WebTwain_Buffer.html#removedocument)| [`GetDocumentInfoList()`]({{site.info}}api/WebTwain_Buffer.html#getdocumentinfolist)| [`GetRawDataAsync()`]({{site.info}}api/WebTwain_Buffer.html#getrawdataasync)|
40+
|[`RemoveDocument()`]({{site.info}}api/WebTwain_Buffer.html#removedocument)| [`GetDocumentInfoList()`]({{site.info}}api/WebTwain_Buffer.html#getdocumentinfolist)|
4141

4242
<!--
4343
* [`ClearImageTags()`]({{site.info}}api/WebTwain_Buffer.html#clearimagetags)
@@ -474,7 +474,7 @@ permalink: /info/api/
474474
| [`hide()`]({{site.info}}api/WebTwain_Viewer.html#hide)| [`last()`]({{site.info}}api/WebTwain_Viewer.html#last)| [`next()`]({{site.info}}api/WebTwain_Viewer.html#next)|[`off()`]({{site.info}}api/WebTwain_Viewer.html#off)|
475475
|[`on()`]({{site.info}}api/WebTwain_Viewer.html#on)| [`previous()`]({{site.info}}api/WebTwain_Viewer.html#previous)| [`render()`]({{site.info}}api/WebTwain_Viewer.html#render)| [`setButtonClass()`]({{site.info}}api/WebTwain_Viewer.html#setbuttonclass)|
476476
| [`setSelectedAreas()`]({{site.info}}api/WebTwain_Viewer.html#setselectedareas)| [`setViewMode()`]({{site.info}}api/WebTwain_Viewer.html#setviewmode) | [`show()`]({{site.info}}api/WebTwain_Viewer.html#show)| [`unbind()`]({{site.info}}api/WebTwain_Viewer.html#unbind)|
477-
|[`createTemplate()`]({{site.info}}api/WebTwain_Viewer.html#createtemplate)| [`createDocumentEditor()`]({{site.info}}api/WebTwain_Viewer.html#createdocumenteditor)| [`updateCheckboxStyle()`]({{site.info}}api/WebTwain_Viewer.html#updatecheckboxstyle)| [`updatePageNumberStyle()`]({{site.info}}api/WebTwain_Viewer.html#updatepagenumberstyle)|
477+
| [`createDocumentEditor()`]({{site.info}}api/WebTwain_Viewer.html#createdocumenteditor)| [`updateCheckboxStyle()`]({{site.info}}api/WebTwain_Viewer.html#updatecheckboxstyle)| [`updatePageNumberStyle()`]({{site.info}}api/WebTwain_Viewer.html#updatepagenumberstyle)|
478478

479479
<!--
480480
* [`bind()`]({{site.info}}api/WebTwain_Viewer.html#bind)

0 commit comments

Comments
 (0)