Thanks for Downloading Dynamic Web TWAIN 30-Day Trial!
Your download will start shortly. If your download does not begin, click here to retry.
Configuring the Dynamic Web TWAIN Service
This article is meant exclusively for the Desktop Service Edition of Dynamic Web TWAIN.
The Dynamic Web TWAIN Service is the core piece of Dynamic Web TWAIN when running in Service mode. It handles the communication between hardware (scanner, webcam, etc.) and browser, manages the image buffer, and coordinates data between different modules.
IP and ports
The Dynamic Web TWAIN Service uses localhost
and 18622
18625
ports for HTTP connection and 18623
18626
ports for HTTPS connection.
These ports can be configured in the DSConfiguration.ini
file located in:
- Windows:
C:\Program Files (x86)\Dynamsoft\Dynamic Web TWAIN Service {versionnumber}
(version 18.5.1 and earlierC:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64_{versionnumber}
) - macOS:
Go > Applications > Dynamsoft > Dynamic Web TWAIN Service {versionnumber}
(version 18.5.1 and earlierGo > Applications > Dynamsoft > DynamsoftServicex64_{versionnumber} > {installed version No.}
) - Linux:
/opt/dynamsoft/Dynamic Web TWAIN Service {versionnumber}
(version 18.5.1 and earlier/opt/dynamsoft/DynamsoftService
)
Access-Control-Allow-Origin
For security purposes, you may want the Dynamic Web TWAIN Service to only respond to requests from specified origins. Starting from Dynamic Web TWAIN version 18.5, this can be achieved by adding Access-Control-Allow-Origin
in the DSConfiguration.ini
file.
By default, the Access-Control-Allow-Origin
setting is not configured in the ini file. This means that the Dynamic Web TWAIN Service can respond to requests from any origin.
You can set multiple origins by using commas as the separator, and http://
or https://
needs to be specified before each origin. If there is a port for the origin, please remember to specify it. If not specified, the default port is 80.
No origin:
Access-Control-Allow-Origin=*
Single origin:
Access-Control-Allow-Origin=http://192.168.8.212
Multiple origins:
Access-Control-Allow-Origin=http://192.168.8.212, http://192.168.8.126:8033, https://www.dynamsoft.com
After configuring the origins in the DSConfiguration.ini
file, please set IfCheckCORS
to true
in dynamsoft.webtwain.config.js
.
When a request comes from a different origin, a CORS error message will be displayed, both in a pop-up and in the console.
Installation of Dynamic Web TWAIN Service
On a desktop, when a new user accesses a web page using Dynamic Web TWAIN SDK for the first time, he will be prompted to install the Dynamic Web TWAIN Service. This is a built-in behaviour of the library. The prompt will display the download link. Once the installer is downloaded, the installation process will take just a few seconds.
The prompt comes up when you try to create a WebTwain instance in Service mode.
On Windows and macOS, double click the downloaded installer to install the service.
On Linux, instead of double clicking, the downloaded installer needs to be run using one of the following commands:
-
Debian / Ubuntu
sudo dpkg -i DynamicWebTWAINServiceSetup.deb
-
Fedora
sudo rpm -ivh DynamicWebTWAINServiceSetup.rpm
Once the installation is done, the users can click the orange sentence ‘click here to verify completion’ or refresh the page to start using Dynamic Web TWAIN.
Msg: Dynamic Web TWAIN Service is not installed / Dynamic Web TWAIN is not installed
If Dynamic Web TWAIN Service is not installed, users may receive the error ‘The Dynamic Web TWAIN module is not installed’ when accessing an application that uses Dynamic Web TWAIN.