Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 49 additions & 3 deletions _articles/extended-usage/advanced-initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ description: Advanced DWT Initialization

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.

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

## Auto-Loading with CDN/Package Manager Resources

Expand All @@ -35,6 +34,53 @@ The resource files loaded from CDNs and package managers slightly differ from th

Dynamsoft.DWT.ResourcesPath = "https://cdn.jsdelivr.net/dwt@latest/dist"; // Load supporting resources from here
Dynamsoft.DWT.ProductKey = ""; // Add product key here
//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.
Dynamsoft.DWT.ServiceInstallerLocation = 'https://unpkg.com/dwt/dist/dist/';
// Configure the default WebTwain instance
Dynamsoft.DWT.Containers = [{
ContainerId: 'dwtcontrolContainer', // Binds WebTwain to container by ID
Width: 270,
Height: 320
}];
// Instantiate the WebTwain instance upon loading resources
Dynamsoft.DWT.AutoLoad = true;

// Retrieve WebTwain object after initializing DWT
Dynamsoft.DWT.RegisterEvent("OnWebTwainReady", function () {
DWTObject = Dynamsoft.DWT.GetWebTwain("dwtcontrolContainer"); // Retrieve instantiated WebTwain object

// Include this block to verify WebTwain instantiation
/*
if (DWTObject) {
alert("WebTwain object instantiated");
}
*/
});
</script>
</body>
</html>
```

### Loading from UNPKG

> [!WARNING]
> UNPKG may not provide any guarantees of uptime or technical support.

```html
<html>
<head>
<!-- Load resources from UNPKG CDN -->
<script src="https://unpkg.com/dwt@19.2.0/dist/dynamsoft.webtwain.min.js"></script>
</head>

<body>
<div id="dwtcontrolContainer"></div> <!-- The WebTwain object binds to this div by default -->
<script>
var DWTObject; // Use this to store the WebTwain object after retrieval

Dynamsoft.DWT.ResourcesPath = "https://unpkg.com/dwt@19.2.0/dist"; // Load supporting resources from here
Dynamsoft.DWT.ProductKey = ""; // Add product key here

// Configure the default WebTwain instance
Dynamsoft.DWT.Containers = [{
Expand Down Expand Up @@ -76,7 +122,7 @@ APIs used:

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.

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

## Configuring Default `WebTwain` Instances

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

- `Dynamsoft.Lib`

This contains information such as environment detection results (`Dynamsoft.Lib.env`), and global methods such as `showMask()` and `hideMask()`.
This contains information such as environment detection results (`Dynamsoft.Lib.env`), and global methods such as `showMask()` and `hideMask()`.
2 changes: 2 additions & 0 deletions _articles/extended-usage/barcode-processing.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ DWTObject.Addon.BarcodeReader.getRuntimeSettings()
});
```

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

### Specify maximum barcode count

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.
Expand Down
14 changes: 10 additions & 4 deletions _articles/faq/dwt-with-annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,21 @@ API Reference
- [`openDocument()`](https://www.dynamsoft.com/document-viewer/docs/api/class/editviewer.html#opendocument)

### 3.3 Create a Viewerless Dynamic Web TWAIN Instance

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`:

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"`.
2. Use a different CDN with a higher per-file size limit by referencing the location with `Dynamsoft.DWT.ServiceInstallerLocation = "https://unpkg.com/dwt@19.2.0/dist/dist"`.

```javascript
// Create Dynamic Web TWAIN object
// Public trial license which is valid for 24 hours
// You can request a 30-day trial key from https://www.dynamsoft.com/customer/license/trialLicense/?product=dwtddv
Dynamsoft.DWT.ProductKey = "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9";
Dynamsoft.DWT.UseDefaultViewer = false;
Dynamsoft.DWT.ResourcesPath = "https://cdn.jsdelivr.net/npm/dwt@19.2.0/dist";
// 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.
Dynamsoft.DWT.ServiceInstallerLocation = 'https://download2.dynamsoft.com/Demo/DWT/Resources/dist/';
// Do not forget to set your installer path
Dynamsoft.DWT.ServiceInstallerLocation = "YOUR_INSTALLER_PATH_HERE";

let DWObject;
// Create a Dynamic Web TWAIN instance without the built-in viewer
Expand Down Expand Up @@ -317,8 +323,8 @@ let DWObject, editViewer, ddvDoc;
Dynamsoft.DWT.ProductKey = license;
Dynamsoft.DWT.UseDefaultViewer = false;
Dynamsoft.DWT.ResourcesPath = "https://cdn.jsdelivr.net/npm/dwt@19.2.0/dist";
// 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.
Dynamsoft.DWT.ServiceInstallerLocation = 'https://download2.dynamsoft.com/Demo/DWT/Resources/dist/';
// Do not forget to set your installer path
Dynamsoft.DWT.ServiceInstallerLocation = "YOUR_INSTALLER_PATH_HERE";

// Create a Dynamic Web TWAIN instance without the built-in viewer
Dynamsoft.DWT.CreateDWTObjectEx({
Expand Down
10 changes: 5 additions & 5 deletions _articles/info/api/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -2028,8 +2028,8 @@ interface TextResult {
}
```

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

Expand Down Expand Up @@ -2130,7 +2130,7 @@ interface RuntimeSettings {

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

### FurtherModes

Expand All @@ -2154,7 +2154,7 @@ interface FurtherModes {
}
```

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

### Region

Expand All @@ -2169,7 +2169,7 @@ interface Region {
regionTop: number;
}
```
- 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.
- 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.

## FileUploader

Expand Down
4 changes: 1 addition & 3 deletions _articles/info/api/restful.md
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ fetch(url, requestOptions)

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

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

#### Parameters

Expand Down Expand Up @@ -2020,8 +2020,6 @@ HTTP Status Code **200**

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

Blank page detection is **only supported on Windows**.

#### Parameters

|Name|Location|Type|Required|Restrictions|Description|
Expand Down