Resources Base
Table of contents

Development

How to customize the installation dialog

UI 1

This installation dialog is opened by one of the following functions

  • OnWebTwainNotFoundOnWindowsCallback

For Windows clients

  • OnWebTwainNotFoundOnLinuxCallback

For Linux clients

  • OnWebTwainNotFoundOnMacCallback

For macOS clients

  • OnRemoteWebTwainNotFoundCallback

For any client that connects to a remote Dynamsoft Service

All four of these functions eventually call the global API Dynamsoft.DWT.ShowDialog() to show the installation dialog. You can use your own method to show the necessary information so that your users know how to proceed. For example

function OnWebTwainNotFoundOnWindowsCallback(ProductName, InstallerUrl, bHTML5, bIE, bSafari, bSSL, strIEVersion) {
    alert(ProductName + " is not installed, please download and install it from " + InstallerUrl);
}
// same for macOS & Linux...
function OnRemoteWebTwainNotFoundCallback(ProductName, ip, port, bSSL) {
    alert("The Dynamsoft Service is not installed or not running on the machine with IP" + ip);
}

When and where to override these functions

If you are not using dynamsoft.webtwain.min.js or dynamsoft.webtwain.min.mjs . you can simply make the changes in the file dynamsoft.webtwain.install.js .

If you are using dynamsoft.webtwain.min.js or dynamsoft.webtwain.min.mjs , the file dynamsoft.webtwain.install.js doesn’t exist. In this case, you must make the changes before you create a WebTwain instance . For example

Dynamsoft.OnWebTwainNotFoundOnWindowsCallback = function(ProductName, InstallerUrl, bHTML5, bIE, bSafari, bSSL, strIEVersion) {
    alert(ProductName + " is not installed, please download and install it from " + InstallerUrl);
}
Dynamsoft.DWT.Load();

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest Version
    • Version 17.0
    • Version 16.2
    • Version 16.1.1
    Change +
    © 2003–2021 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support