Created
August 6, 2020 08:20
-
-
Save yushulx/c16c2ffed31a8bf05336ea1b4cbadc10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Hello World</title> | |
| <script type="text/javascript" src="Resources/dynamsoft.webtwain.initiate.js"></script> | |
| <script type="text/javascript" src="Resources/dynamsoft.webtwain.config.js"></script> | |
| </head> | |
| <body> | |
| <div id="dwtcontrolContainer" ></div> | |
| <input type="button" value="Scan" onclick="AcquireImage();" /> | |
| <script type="text/javascript"> | |
| function AcquireImage() { | |
| var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); | |
| if (DWObject) { | |
| DWObject.SelectSource(function () { | |
| var OnAcquireImageSuccess = OnAcquireImageFailure = function () { | |
| DWObject.CloseSource(); | |
| }; | |
| DWObject.OpenSource(); | |
| DWObject.IfDisableSourceAfterAcquire = true; | |
| DWObject.AcquireImage(OnAcquireImageSuccess, OnAcquireImageFailure); | |
| }, function () { | |
| console.log('SelectSource failed!'); | |
| }); | |
| } | |
| } | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment