Dynamic Web TWAIN: How to enable remote scan

With Dynamic Web TWAIN v12 or above, it's possible to set up a Dynamic Web TWAIN service that can be accessed remotely from other computers or even mobile devices. To learn more about this feature, please refer to How "Remote Scan" Works in Dynamic Web TWAIN 12.0

 

The following are the steps to do this.

 

Step 1. Download and install version 12.x of Dynamic Web TWAIN on the machine that has a scanner connected.

To get a 30-day free trial version, please check this page. If you are an existing customer, please email sales@dynamsoft.com for a full version installer.

 

Step 2. Find a local sample to get started with.

For example, you can start with this local demo under C:\Program Files (x86)\Dynamsoft\Dynamic Web TWAIN SDK 12.0 Trial\Samples\Scan\CustomScan.html

 

Step 3. Configure the followings to enable the remote scanning feature.

  1. Update the file DWTConfiguration.ini. It is typically under C:\Windows\SysWOW64\Dynamsoft\DynamicWebTwain\ForChrome\DWTConfiguration.ini

    Note: here we assume the machine has the IP 192.168.3.7.

    [DynamicWebTWAIN]
    LogLevel=6
    Port=18618
    PortSSL=18619
    Server=192.168.3.7
    EnableScannerAccessAuth=FALSE
    EnableFileAccessAuth=FALSE
    EnableWebcamAccessAuth=FALSE

  2. Add the same server address to the file \Resources\dynamsoft.webtwain.config.js like this
    Dynamsoft.WebTwainEnv.ServerAddress={"Server": "192.168.3.7", "Port": 18618, "SSLPort": 18619};

  3. Find the service Dynamsoft WebTWAIN Service in Windows services list and restart it.

 

Step 4. Modify your scan page code to better fit in the use in remote scanning.

Still take the "CustomScan.html" sample as an example, please remove the "Show UI" option and modify related JavaScript code.

<input type="checkbox" id="ShowUI" checked="checked">Show UI<br />

if (document.getElementById("ShowUI").checked)
DWObject.IfShowUI = true;
else
DWObject.IfShowUI = false;

Reason: if the Show UI is used for scanning, then when you scan from a remote web browser, the popup scanner UI dialog is actually shown on the host machine (where installs the web twain service and physically connects with scanners). You won't be able to see the dialog or close it remotely.  In fact, all popup dialogs from the scanner can't be controlled remotely.

 

Step 5. Deploy the web scan app to your web server (such as IIS).

Once done, you can access the scan page locally to see if the scanning is working fine. Then you can go on testing the scanning from a remote browser.

 

For any issues found, please report to support@dynamsoft.com.