命名Dynamic Web TWAIN對象
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
< title
data-filtered = "filtered" >Hello
World</ title > < script
type = "text/javascript"
src = "Resources/dynamsoft.webtwain.initiate.js"
data-filtered = "filtered" >
</ script > < script
type = "text/javascript"
src = "Resources/dynamsoft.webtwain.config.js"
data-filtered = "filtered" >
</ script > < input
type = "button"
value = "Scan"
onclick = "AcquireImage();" > < div
id = "dwtcontrolContainer" >
</ div > < script
type = "text/javascript"
data-filtered = "filtered" > var
DWObject; function
Dynamsoft_OnReady(){ DWObject
= Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); } function
AcquireImage(){ if(DWObject)
{ DWObject.IfDisableSourceAfterAcquire
= true; DWObject.SelectSource(); DWObject.OpenSource(); DWObject.AcquireImage(); } } </ script > |
1
|
Dynamsoft.WebTwainEnv.Containers
= [{ContainerId:'dwtcontrolContainer',Width:270,Height:350}]; |
更改查看器的大小
1
|
Dynamsoft.WebTwainEnv.Containers
= [{ContainerId:'dwtcontrolContainer',Width: '50%',Height:350}]; |
更改安裝提示的樣式
1
2
3
4
5
6
|
.DYNLogo { background:url(logo.gif)
left top no-repeat; width:159px; height:39px; } |
1
2
3
4
5
6
7
8
9
10
11
12
|
function
OnWebTwainNotFoundOnWindowsCallback(ProductName, InstallerUrl, bHTML5, bIE, bSafari, bSSL, strIEVersion)
{ } /*
This callback is triggered when Dynamic Web TWAIN is not installed on a PC running Windows */ function
OnWebTwainNotFoundOnMacCallback(ProductName, InstallerUrl, bHTML5, bIE, bSafari, bSSL, strIEVersion)
{ } /*
This callback is triggered when Dynamic Web TWAIN is not installed on a MAC */ function
OnWebTwainOldPluginNotAllowedCallback(ProductName) { } /*
This callback is triggered when Dynamic Web TWAIN is disabled by a non-IE browser */ function
OnWebTwainNeedUpgradeCallback(ProductName, InstallerUrl, bHTML5, bMac, bIE, bSafari, bSSL, strIEVersion)
{ } /*
This callback is triggered when Dynamic Web TWAIN installed on the machine is older than the //one on the
server and upgrade is needed */ |
本次教程到此結束,希望能對Dynamic Web TWAIN的用戶帶來幫助,接下來還會有更多的相關教程,敬請期待!