OnWebTwainReady

Description

This event is triggered as soon as Dynamic Web TWAIN is successfully loaded and initialized on the page.

Syntax

Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);

function Dynamsoft_OnReady() {...}

or

Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', function() {...});

Remarks

This is the best place to set up Dynamic Web TWAIN (change the size of it, add event listeners, etc.) as shown below in the example.

Example

Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);

function Dynamsoft_OnReady() {
    var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
    DWObject.Width = 270;  
    DWObject.Height = 350;	
    //Add event listeners to DWObject
    DWObject.RegisterEvent("OnPostTransfer", function(){...}); 
    DWObject.RegisterEvent("OnPostLoad", function(){...}); 
    DWObject.RegisterEvent("OnMouseClick", function(){...}); 
}