How to initialize Web TWAIN object manually

Scenario:

For customers who are using Dynamic Web TWAIN v10.0.1 or above, it's possible to disable the automatic loading of the Dynamic Web TWAIN service. To do so, please follow the steps below:

Steps:

#1. Set the value of Dynamsoft.WebTwainEnv.AutoLoad to false in dynamsoft.webtwain.config.js.


Dynamsoft.WebTwainEnv.AutoLoad = false; // The property is set to true by default.

#2. Use methods Dynamsoft.WebTwainEnv.Load and Dynamsoft.WebTwainEnv.Unload to dynamically load and unload the control.

 
function UnloadControl() {
  //Unload the control manually
  Dynamsoft.WebTwainEnv.Unload();
}

function LoadControl() {
  //Load the control manually
  Dynamsoft.WebTwainEnv.Load(); 
}