Skip to content

Commit fee675d

Browse files
Merge pull request #927 from dynamsoft-docs/preview
update to internal commit d9ab7f09
2 parents 47a6447 + 8c7f164 commit fee675d

File tree

5 files changed

+67
-15
lines changed

5 files changed

+67
-15
lines changed

_articles/extended-usage/advanced-initialization.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ description: Advanced DWT Initialization
1313
1414
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.
1515

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).
1716

1817
## Auto-Loading with CDN/Package Manager Resources
1918

@@ -35,6 +34,53 @@ The resource files loaded from CDNs and package managers slightly differ from th
3534
3635
Dynamsoft.DWT.ResourcesPath = "https://cdn.jsdelivr.net/dwt@latest/dist"; // Load supporting resources from here
3736
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.
39+
Dynamsoft.DWT.ServiceInstallerLocation = 'https://unpkg.com/dwt/dist/dist/';
40+
// Configure the default WebTwain instance
41+
Dynamsoft.DWT.Containers = [{
42+
ContainerId: 'dwtcontrolContainer', // Binds WebTwain to container by ID
43+
Width: 270,
44+
Height: 320
45+
}];
46+
// Instantiate the WebTwain instance upon loading resources
47+
Dynamsoft.DWT.AutoLoad = true;
48+
49+
// Retrieve WebTwain object after initializing DWT
50+
Dynamsoft.DWT.RegisterEvent("OnWebTwainReady", function () {
51+
DWTObject = Dynamsoft.DWT.GetWebTwain("dwtcontrolContainer"); // Retrieve instantiated WebTwain object
52+
53+
// Include this block to verify WebTwain instantiation
54+
/*
55+
if (DWTObject) {
56+
alert("WebTwain object instantiated");
57+
}
58+
*/
59+
});
60+
</script>
61+
</body>
62+
</html>
63+
```
64+
65+
### Loading from UNPKG
66+
67+
> [!WARNING]
68+
> UNPKG may not provide any guarantees of uptime or technical support.
69+
70+
```html
71+
<html>
72+
<head>
73+
<!-- Load resources from UNPKG CDN -->
74+
<script src="https://unpkg.com/[email protected]/dist/dynamsoft.webtwain.min.js"></script>
75+
</head>
76+
77+
<body>
78+
<div id="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
3884
3985
// Configure the default WebTwain instance
4086
Dynamsoft.DWT.Containers = [{
@@ -76,7 +122,7 @@ APIs used:
76122

77123
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.
78124

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).
80126
81127
## Configuring Default `WebTwain` Instances
82128

@@ -355,4 +401,4 @@ DWT operates under the `Dynamsoft` namespace, and most of its features may be fo
355401

356402
- `Dynamsoft.Lib`
357403

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()`.

_articles/extended-usage/barcode-processing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ DWTObject.Addon.BarcodeReader.getRuntimeSettings()
133133
});
134134
```
135135

136+
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+
136138
### Specify maximum barcode count
137139

138140
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.

_articles/faq/dwt-with-annotation.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,21 @@ API Reference
114114
- [`openDocument()`](https://www.dynamsoft.com/document-viewer/docs/api/class/editviewer.html#opendocument)
115115

116116
### 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+
117123
```javascript
118124
// Create Dynamic Web TWAIN object
119125
// Public trial license which is valid for 24 hours
120126
// You can request a 30-day trial key from https://www.dynamsoft.com/customer/license/trialLicense/?product=dwtddv
121127
Dynamsoft.DWT.ProductKey = "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9";
122128
Dynamsoft.DWT.UseDefaultViewer = false;
123129
Dynamsoft.DWT.ResourcesPath = "https://cdn.jsdelivr.net/npm/[email protected]/dist";
124-
// 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.
125-
Dynamsoft.DWT.ServiceInstallerLocation = 'https://download2.dynamsoft.com/Demo/DWT/Resources/dist/';
130+
// Do not forget to set your installer path
131+
Dynamsoft.DWT.ServiceInstallerLocation = "YOUR_INSTALLER_PATH_HERE";
126132

127133
let DWObject;
128134
// Create a Dynamic Web TWAIN instance without the built-in viewer
@@ -317,8 +323,8 @@ let DWObject, editViewer, ddvDoc;
317323
Dynamsoft.DWT.ProductKey = license;
318324
Dynamsoft.DWT.UseDefaultViewer = false;
319325
Dynamsoft.DWT.ResourcesPath = "https://cdn.jsdelivr.net/npm/[email protected]/dist";
320-
// 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.
321-
Dynamsoft.DWT.ServiceInstallerLocation = 'https://download2.dynamsoft.com/Demo/DWT/Resources/dist/';
326+
// Do not forget to set your installer path
327+
Dynamsoft.DWT.ServiceInstallerLocation = "YOUR_INSTALLER_PATH_HERE";
322328
323329
// Create a Dynamic Web TWAIN instance without the built-in viewer
324330
Dynamsoft.DWT.CreateDWTObjectEx({

_articles/info/api/interfaces.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2028,8 +2028,8 @@ interface TextResult {
20282028
}
20292029
```
20302030

2031-
- [`EnumBarcodeFormat`](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/enum/EnumBarcodeFormat.html?ver=9.6.33)
2032-
- [`EnumBarcodeFormat_2`](https://www.dynamsoft.com/barcode-reader/docs/web/programming/javascript/api-reference/enum/EnumBarcodeFormat_2.html?ver=9.6.33)
2031+
- [`EnumBarcodeFormat`](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/enum/EnumBarcodeFormat.html?ver=9.6.42)
2032+
- [`EnumBarcodeFormat_2`](https://www.dynamsoft.com/barcode-reader/docs/v9/web/programming/javascript/api-reference/enum/EnumBarcodeFormat_2.html?ver=9.6.42)
20332033
- [`LocalizationResult`](/_articles/info/api/interfaces.md#localizationresult)
20342034
- [`Result`](/_articles/info/api/interfaces.md#result)
20352035

@@ -2130,7 +2130,7 @@ interface RuntimeSettings {
21302130

21312131
- [`FurtherModes`](/_articles/info/api/interfaces.md#furthermodes)
21322132
- [`Region`](/_articles/info/api/interfaces.md#region)
2133-
- 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.
21342134

21352135
### FurtherModes
21362136

@@ -2154,7 +2154,7 @@ interface FurtherModes {
21542154
}
21552155
```
21562156

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.
21582158

21592159
### Region
21602160

@@ -2169,7 +2169,7 @@ interface Region {
21692169
regionTop: number;
21702170
}
21712171
```
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.
21732173

21742174
## FileUploader
21752175

_articles/info/api/restful.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ fetch(url, requestOptions)
18161816

18171817
Create a new document process to read a barcode on a scanned page.
18181818

1819-
Barcode scanning requires a valid Barcode Reader Add-On license. Blank page detection is only supported on Windows.
1819+
Barcode scanning requires a valid Barcode Reader Add-On license.
18201820

18211821
#### Parameters
18221822

@@ -2020,8 +2020,6 @@ HTTP Status Code **200**
20202020

20212021
Create a new document process to check if a scanned page is blank.
20222022

2023-
Blank page detection is **only supported on Windows**.
2024-
20252023
#### Parameters
20262024

20272025
|Name|Location|Type|Required|Restrictions|Description|

0 commit comments

Comments
 (0)