Reference Guide
Reference Guides / JavaScript API / Events / RegisterOnTwainAcquisitionDialogCancelButtonClick
In This Topic
    In This Topic

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

    RegisterOnTwainAcquisitionDialogCancelButtonClick: function (docuViewareID, callback)


    The identifier for the DocuVieware™ instance.
    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 RegisterOnTwainAcquisitionDialogCancelButtonClickOnDocuViewareAPIReady() {
        if (typeof DocuViewareAPI !== "undefined" && DocuViewareAPI.IsInitialized("DocuVieware1")) {
            DocuViewareAPI.RegisterOnTwainAcquisitionDialogCancelButtonClick("DocuVieware1", function () { console.log("acquisition dialog canceled"); });
        else {
            setTimeout(function () { RegisterOnTwainAcquisitionDialogCancelButtonClickOnDocuViewareAPIReady() }, 10);
    document.addEventListener("DOMContentLoaded", function () {
    }, false);