How to make the User Interface close automatically after scanning?

When you acquire images with the User Interface (UI), the UI does not close automatically after all the transfers end. To close the User Interface automatically,  you can set the IfDisableSourceAfterAcquire property to true.

 

Javascript Code

function btnScan() 
  {
    DWObject.SelectSource();
    DWObject.OpenSource();
    DWObject.IfShowUI = true;
   
    DWObject.IfDisableSourceAfterAcquire = true;
    //disable the data source after transfers end
   
    DWObject.AcquireImage();
  }

Alternatively, you can also call DisableSource or CloseSource in the OnPostAllTransfers event.

Javascript Code

DWObject.RegisterEvent("OnPostAllTransfers", onPostAllTransfers);
function onPostAllTransfers() { 
  DWObject.DisableSource(); //disable source 
}

Reference:

IfDisableSourceAfterAcquire
DisableSource
CloseSource
OnPostAllTransfers

Is this page helpful?

Leave a Reply

Your email address will not be published.