Skip to content
Merged

v19.4.2 #1068

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
119 changes: 94 additions & 25 deletions _articles/faq/change-reference-path.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,123 @@
layout: default-layout
noTitleIndex: true
needAutoGenerateSidebar: true
title: How can I change the reference path to the Dynamsoft's resources in my project?
title: How can I change the reference path to the Dynamsoft resources in my project?
keywords: Dynamic Web TWAIN, Project Deployment and End-user Installation, reference path, resources path, 2803, 2804
breadcrumbText: How can I change the reference path to the Dynamsoft's resources in my project?
description: How can I change the reference path to the Dynamsoft's resources in my project?
breadcrumbText: How can I change the reference path to the Dynamsoft resources in my project?
description: How can I change the reference path to the Dynamsoft resources in my project?
date: 2021-07-14 18:58:25 +0000
last_modified: 2025-02-06 17:18:09 +0000
last_modified: 2026-07-29 00:00:00 +0000
---
View all FAQs about [Project Deployment and End-user Installation](
https://www.dynamsoft.com/web-twain/docs/faq/#project-deployment-and-end-user-installation)

# How can I change the reference path to the Dynamsoft's resources in my project?
# How can I change the reference path to the Dynamsoft resources in my project?

This also applies if you see the following errors in browser console, please make sure that the ResourcesPath is set correctly in *dynamsoft.webtwain.config.js* (Step 3 Below).
>{"code": -2803, "message": "Loading the WebTwain JavaScript source files failed."} <br>
>{"code": -2804, "message": "Loading the WebTwain css files failed."}
If you encounter either of the following errors in the browser console,

<strong>Scenario: </strong> For customers who are using Dynamic Web TWAIN, to change the location of the 'Resources' folder, or to rename it, please following the steps below:
> {"code": -2803, "message": "Loading the WebTwain JavaScript source files failed."}
> {"code": -2804, "message": "Loading the WebTwain css files failed."}

<strong>Steps:</strong> In the below example we will assume the original Resources folder is located at '<strong>../{Project Directory}/Resources</strong>', and you want to change it to '<strong>../{Project Directory}/Newfolder/ResourcesTest</strong>'.
it usually means that Dynamic Web TWAIN cannot locate its runtime resources.

Step 1. Please make sure the structure inside 'Resources' folder stay unchanged.
This article explains how Dynamic Web TWAIN locates its resources and how to correctly configure the resource path after moving or renaming the **Resources** folder.

Step 2. Change the relative path in your page where you reference the js files, for example:
## How Dynamic Web TWAIN loads its resources

```html
<script src="Resources/dynamsoft.webtwain.initiate.js"></script>
<!-- or your own operation js file -->
<script src="Scripts/DWTSample_BasicScan.js"></script>
<script src="Resources/dynamsoft.webtwain.config.js"></script>
Dynamic Web TWAIN loads its resources in two stages.

1. Your HTML page first loads the two entry JavaScript files.

2. After initialization, Dynamic Web TWAIN loads all remaining JavaScript files, CSS files according to the value of `Dynamsoft.DWT.ResourcesPath`.

The loading process is illustrated below.

```text
index.html
│ loads
dynamsoft.webtwain.initiate.js
dynamsoft.webtwain.config.js
│ ResourcesPath = "xxxx"
Dynamic Web TWAIN
├── loads CSS files
├── loads additional JavaScript files
├── loads WebAssembly files
└── loads other runtime resources
```

Modify as below:
> **Note**
>
> `ResourcesPath` does **not** determine where `dynamsoft.webtwain.config.js` is located.
>
> Instead, it tells Dynamic Web TWAIN where to find all of its remaining resources after initialization.

## Example project structure

Suppose your project is organized as follows.

```text
Project
├── HTML
│ └── index.html
└── DWT
└── Resources
├── dynamsoft.webtwain.config.js
├── dynamsoft.webtwain.initiate.js
├── dynamsoft.webtwain.install.js
├── addon/
├── src/
├── dist/
└── ...
```

In this example:

- `index.html` is located in the **HTML** folder.
- All Dynamic Web TWAIN resources are located in **DWT/Resources**.

The internal structure of the **Resources** folder must remain unchanged. You may move or rename the folder, but do not modify its contents.

## Step 1. Reference the entry JavaScript files

Because `index.html` is located inside the **HTML** folder, the two entry files should be referenced using the following relative paths.

```html
<script src="Newfolder/ResourcesTest/dynamsoft.webtwain.initiate.js"></script>
<!-- or your own operation js file -->
<script src="Scripts/DWTSample_BasicScan.js"></script>
<script src="Newfolder/ResourcesTest/dynamsoft.webtwain.config.js"></script>
<script type="text/javascript" src="../DWT/Resources/dynamsoft.webtwain.config.js"></script>
<script type="text/javascript" src="../DWT/Resources/dynamsoft.webtwain.initiate.js"></script>
```

Step 3. The same change needs to be done in *dynamsoft.webtwain.config.js* file. Add/uncomment the following line, then change 'Resources' (to 'New folder/ResourcesTest' as in this case):
## Step 2. Configure ResourcesPath

Open the following file.

```text
DWT/Resources/dynamsoft.webtwain.config.js
```

Locate the following line.

```javascript
Dynamsoft.DWT.ResourcesPath = "Resources";
```

Modify as below:
Change it to the same relative path used by your HTML page.

```javascript
Dynamsoft.DWT.ResourcesPath = "Newfolder/ResourcesTest";
Dynamsoft.DWT.ResourcesPath = "../DWT/Resources";
```

## Why do I need to configure both?

The two paths serve different purposes.

| Configuration | Purpose |
|---------------|---------|
| `<script src="...">` | Loads the two entry JavaScript files from your HTML page. |
| `Dynamsoft.DWT.ResourcesPath` | Tells Dynamic Web TWAIN where to load all remaining runtime resources after initialization. |

Even if the two JavaScript files are loaded successfully, Dynamic Web TWAIN will still fail to initialize if `ResourcesPath` is incorrect.
2 changes: 1 addition & 1 deletion _articles/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ description: Dynamic Web TWAIN SDK Documentation FAQ

1. [What are the Resources files?](/_articles/faq/what-are-the-resources-files.md)
2. [What resources of the SDK should be included in my web application?](/_articles/faq/resources-to-be-included-in-SDK.md)
3. [How can I change the reference path to the Dynamsoft's resources in my project?](/_articles/faq/change-reference-path.md)
3. [How can I change the reference path to the Dynamsoft resources in my project?](/_articles/faq/change-reference-path.md)
4. [What is Remote Scan and how do I enable it?](https://www.dynamsoft.com/remote-scan/docs/introduction/)
5. [How can I use Dynamic Web TWAIN in a Citrix environment?](/_articles/faq/use-dwt-in-citrix-env.md)
6. [Is there any component of the Dynamic Web TWAIN SDK that needs to be installed on end-user machines?](/_articles/faq/component-needs-to-be-installed-on-end-user-machine.md)
Expand Down
6 changes: 6 additions & 0 deletions _articles/info/schedule/Stable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ description: Dynamic Web TWAIN SDK Documentation Schedule Stable Release Page

# Stable Releases

## 19.4.2 (07/30/2026)

* Updated third-party libraries to enhance security.
* Fixed an issue occurring when [`IfCheckDCP`](/_articles/faq/use-dwt-in-citrix-env.md) was enabled.
* Fixed an issue where [`OnPostLoad`](/_articles/info/api/WebTwain_IO.md#onpostload) was not triggered when using [`LoadImageFromBase64Binary()`](/_articles/info/api/WebTwain_IO.md#loadimagefrombase64binary) and [`LoadImageFromBinary()`](/_articles/info/api/WebTwain_IO.md#loadimagefrombinary).

## 19.4 (06/11/2026)

### New Features
Expand Down
2 changes: 1 addition & 1 deletion _includes/version-list.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<span class="fullVersionHistory">
<ul class="fullVersionInfo">
<li onclick="changeVersion(this)">Latest Version (19.4)</li>
<li onclick="changeVersion(this)">Latest Version (19.4.2)</li>
<li onclick="changeVersion(this)">Version 19.0</li>
<li onclick="changeVersion(this)">Version 18.5.1</li>
<li onclick="changeVersion(this)">Version 18.4</li>
Expand Down
2 changes: 1 addition & 1 deletion assets/js/setLatestVersion.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var versionNoteLatestVersion = "19.4"
var versionNoteLatestVersion = "19.4.2"

$(function() {
$("#versionNoteLatestVersion").text(" (" + versionNoteLatestVersion + ")")
Expand Down