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
As presented in the standard [initialization guide](/_articles/general-usage/initialization.md), DWT instantiates a default `WebTwain` object in its default configuration. Here, we offer some alternative ways to instantiate `WebTwain` objects, as well as ways to alter the configuration of `WebTwain` objects.
15
15
16
-
> Note: jsDelivr currently has problems delivering the Dynamic Web TWAIN Service installer (`https://cdn.jsdelivr.net/npm/dwt@latest/dist/dist/DynamicWebTWAINServiceSetup.msi`) due to [size restrictions](https://www.jsdelivr.com/documentation#id-configuring-a-default-file-in-packagejson); please consider hosting this particular resource file elsewhere. UNPKG is currently unaffected. For information about the Dynamic Web TWAIN Service, learn more [here](/_articles/extended-usage/dynamsoft-service-configuration.md).
17
16
18
17
## Auto-Loading with CDN/Package Manager Resources
19
18
@@ -35,6 +34,53 @@ The resource files loaded from CDNs and package managers slightly differ from th
35
34
36
35
Dynamsoft.DWT.ResourcesPath="https://cdn.jsdelivr.net/dwt@latest/dist"; // Load supporting resources from here
37
36
Dynamsoft.DWT.ProductKey=""; // Add product key here
37
+
//You need to set the service installer location here since the installer's size exceeds jsdelivr's limit.
38
+
//You'd better host the installers in your own environment.
<divid="dwtcontrolContainer"></div> <!-- The WebTwain object binds to this div by default -->
79
+
<script>
80
+
var DWTObject; // Use this to store the WebTwain object after retrieval
81
+
82
+
Dynamsoft.DWT.ResourcesPath="https://unpkg.com/[email protected]/dist"; // Load supporting resources from here
83
+
Dynamsoft.DWT.ProductKey=""; // Add product key here
38
84
39
85
// Configure the default WebTwain instance
40
86
Dynamsoft.DWT.Containers= [{
@@ -76,7 +122,7 @@ APIs used:
76
122
77
123
Setting values for `Dynamsoft.DWT.AutoLoad` and `Dynamsoft.DWT.Containers` results in identical startup behavior for resources obtained from CDNs and package managers to resources obtained from the official SDK.
78
124
79
-
> Note: jsDelivr currently has problems delivering the Dynamic Web TWAIN Service installer (`https://cdn.jsdelivr.net/npm/dwt@latest/dist/dist/DynamicWebTWAINServiceSetup.msi`) due to [size restrictions](https://www.jsdelivr.com/documentation#id-configuring-a-default-file-in-packagejson); please consider hosting this particular resource file elsewhere. UNPKG is currently unaffected. For information about the Dynamic Web TWAIN Service, learn more [here](/_articles/extended-usage/dynamsoft-service-configuration.md).
125
+
> Note: jsDelivr currently has problems delivering the Dynamic Web TWAIN Service installer (`https://cdn.jsdelivr.net/npm/dwt@latest/dist/dist/DynamicWebTWAINServiceSetup.msi`) due to [size restrictions](https://www.jsdelivr.com/documentation#id-configuring-a-default-file-in-packagejson); please consider hosting this particular resource file elsewhere. You can specify the path using [`ServiceInstallerLocation`](/_articles/info/api/Dynamsoft_WebTwainEnv.md#serviceinstallerlocation). UNPKG is currently unaffected. For information about the Dynamic Web TWAIN Service, learn more [here](/_articles/extended-usage/dynamsoft-service-configuration.md).
80
126
81
127
## Configuring Default `WebTwain` Instances
82
128
@@ -355,4 +401,4 @@ DWT operates under the `Dynamsoft` namespace, and most of its features may be fo
355
401
356
402
-`Dynamsoft.Lib`
357
403
358
-
This contains information such as environment detection results (`Dynamsoft.Lib.env`), and global methods such as `showMask()` and `hideMask()`.
404
+
This contains information such as environment detection results (`Dynamsoft.Lib.env`), and global methods such as `showMask()` and `hideMask()`.
See also [`EnumBarcodeFormat`](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/enum/EnumBarcodeFormat.html?ver=9.6.42) and [`EnumBarcodeFormat_2`](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/enum/EnumBarcodeFormat_2.html?ver=9.6.42).
137
+
136
138
### Specify maximum barcode count
137
139
138
140
By default, the add-on will read as many barcodes as it can. To increase the recognition efficiency, you can use `expectedBarcodesCount` to specify the maximum number of barcodes to recognize according to your scenario.
### 3.3 Create a Viewerless Dynamic Web TWAIN Instance
117
+
118
+
Reference a CDN like `jsDelivr` to fetch most resources using `Dynamsoft.DWT.ResourcesPath`. Notably these resources exclude DWT Service installers, which exceed the `jsDelivr` CDN per-file size limit. You have a few options to set this path with `Dynamsoft.DWT.ServiceInstallerLocation`:
119
+
120
+
1.[Install the DWT SDK](https://www.dynamsoft.com/web-twain/downloads/), extract the DWT service installers (under path like `C:\Program Files (x86)\Dynamsoft\Dynamic Web TWAIN SDK 19.2\Resources\dist`), then self-host the DWT Service installers with `Dynamsoft.DWT.ServiceInstallerLocation = "https://example.com/DWT/Resources/dist"`.
121
+
2. Use a different CDN with a higher per-file size limit by referencing the location with `Dynamsoft.DWT.ServiceInstallerLocation = "https://unpkg.com/[email protected]/dist/dist"`.
122
+
117
123
```javascript
118
124
// Create Dynamic Web TWAIN object
119
125
// Public trial license which is valid for 24 hours
120
126
// You can request a 30-day trial key from https://www.dynamsoft.com/customer/license/trialLicense/?product=dwtddv
//You need to set the service installer location here since the installer's size exceeds jsdelivr's limit. You'd better host the installers in your own environment.
//You need to set the service installer location here since the installer's size exceeds jsdelivr's limit. You'd better host the installers in your own environment.
- For more detailed information, please [click the link](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interface/RuntimeSettings.html?ver=9.6.42) to view.
2133
+
- For more detailed information, please [click the link](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/interface/RuntimeSettings.html?ver=9.6.42) to view.
2134
2134
2135
2135
### FurtherModes
2136
2136
@@ -2154,7 +2154,7 @@ interface FurtherModes {
2154
2154
}
2155
2155
```
2156
2156
2157
-
- For more detailed information, please [click the link](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interface/furthermodes.html?ver=9.6.42) to view.
2157
+
- For more detailed information, please [click the link](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/interface/furthermodes.html?ver=9.6.42) to view.
2158
2158
2159
2159
### Region
2160
2160
@@ -2169,7 +2169,7 @@ interface Region {
2169
2169
regionTop:number;
2170
2170
}
2171
2171
```
2172
-
- For more detailed information, please [click the link](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/interface/Region.html?ver=9.6.42) to view.
2172
+
- For more detailed information, please [click the link](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/interface/Region.html?ver=9.6.42) to view.
0 commit comments