DocuVieware Reference Guide
RegisterOnTwainAcquisitionDialogAcquireButtonClick
Reference Guides > JavaScript API > Events > RegisterOnTwainAcquisitionDialogAcquireButtonClick
 RegisterOnTwainAcquisitionDialogAcquireButtonClick

This function allows you trigger a function of your own when the Acquire button from the TWAIN acquisition dialog is clicked.

RegisterOnTwainAcquisitionDialogAcquireButtonClick: function (docuViewareID, callback)

Parameters

docuViewareID
The identifier for the DocuVieware™ instance.
callback
The function you want to execute on event.

Return Value

1 if error.

Example of usage

This JavaScript makes sure the DocuVieware control is properly loaded and initialized and then subscribes to the event on load.

function RegisterOnTwainAcquisitionDialogAcquireButtonClickOnDocuViewareAPIReady() {
    if (typeof DocuViewareAPI !== "undefined" && DocuViewareAPI.IsInitialized("DocuVieware1")) {
        DocuViewareAPI.RegisterOnTwainAcquisitionDialogAcquireButtonClick("DocuVieware1", function () { console.log("Acquire button clicked"); });
    }
    else {
        setTimeout(function () { RegisterOnTwainAcquisitionDialogAcquireButtonClickOnDocuViewareAPIReady() }, 10);
    }
}
document.addEventListener("DOMContentLoaded", function () {
    RegisterOnTwainAcquisitionDialogAcquireButtonClickOnDocuViewareAPIReady();
}, false);