Dynamic Web TWAIN正式版
问题1:如何上传到Web服务器/strong>
答:代码如下
DWObject = document.getElementById("dwtcontrolContainer"); = document.getElementById("dwtcontrolContainer");//dwtcontrolContainer is the id of the Dynamic Web TWAIN on the page (An object or an embed).//dwtcontrolContainer is the id of the Dynamic Web TWAIN on the page (An object or an embed).function btnScan_onclick() function btnScan_onclick(){{DWObject.SelectSource();DWObject.SelectSource();DWObject.OpenSource();DWObject.OpenSource();DWObject.AcquireImage();DWObject.AcquireImage();}}function btnUpload_onclick() function btnUpload_onclick(){{var strActionPage;var strActionPage;var strHostIP;var strHostIP;var CurrentPathName = unescape(location.pathname); // get current PathName in var CurrentPathName = unescape(location.pathname); // get current PathName inplain ASCIIvar CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/")+ 1); + 1);strActionPage = CurrentPath + "SaveToFile.aspx"; //the ActionPage's file path= CurrentPath + "SaveToFile.aspx"; //the ActionPage's file pathstrHostIP = "localhost"; //The host's IP or name = "localhost"; //The host's IP or nameDWObject.HTTPPort = 80; DWObject.HTTPPort = 80;DWObject.HTTPUploadThroughPost(strHostIP,0,strActionPage,"imageData.tif");DWObject.HTTPUploadThroughPost(strHostIP,0,strActionPage,"imageData.tif");if (DWObject.ErrorCode != 0)if (DWObject.ErrorCode != 0)alert(DWObject.ErrorString);(DWObject.ErrorString);else //succeedelse //succeedalert("Image Uploaded successfully");("Image Uploaded successfully");}}
问题2:如何使用ADF们希望将每个文档保存在单独的文件中。
答:代码如下
var iDocumentCounter =0; iDocumentCounter =0;function BeginScan(){function BeginScan(){ DWObject.OpenSource();DWObject.OpenSource(); DWObject.IfShowUI = false;DWObject.IfShowUI = false; DWObject.IfDisableSourceAfterAcquire = true;DWObject.IfDisableSourceAfterAcquire = true; If(DWObject.Duplex != EnumDWT_DUPLEX.TWDX_NONE)If(DWObject.Duplex != EnumDWT_DUPLEX.TWDX_NONE) DWObject.IfDuplexEnabled = true; //enable duplexDWObject.IfDuplexEnabled = true; //enable duplexDWObject.IfFeederEnabled = true;DWObject.IfFeederEnabled = true; if (DWObject.IfFeederEnabled == true){if (DWObject.IfFeederEnabled == true){ DWObject.XferCount = -1;DWObject.XferCount = -1; if(DWObject.IfFeederLoaded == True)if(DWObject.IfFeederLoaded == True) DWObject.AcquireImage();DWObject.AcquireImage(); }}}}function DWObject_OnPosttransfer(){function DWObject_OnPosttransfer(){iDocumentCounter = iDocumentCounter + 1;= iDocumentCounter + 1;if(DWObject.SaveAsBMP("C:\Image\" + iDocumentCounter + ".bmp", 0) == false)if(DWObject.SaveAsBMP("C:\Image\" + iDocumentCounter + ".bmp", 0) == false) alert( DWObject.ErrorString);( DWObject.ErrorString);}}
问题3:如何使用SSL/strong>
答:您可以使用IfSSL属性。以下JavaScript示例显示了如何使用IfSSL属性。
function btnUpload_onclick() btnUpload_onclick(){{ DWObject.HTTPPort = 80; DWObject.HTTPPort = 80; DWObject.IfSSL = false; // if 80 is the port number of DWObject.IfSSL = false; // if 80 is the port number ofnon-secure port-secure port /* /* DWObject.HTTPPort = 443; DWObject.IfSSL = true; // if 443 is the port number of secureport */ DWObject.HTTPUploadThroughPost("127.0.0.1", 0, DWObject.HTTPUploadThroughPost("127.0.0.1", 0,"/SaveToFile.php", "imageData.jpg");"/SaveToFile.php", "imageData.jpg"); if (DWObject.ErrorCode != 0)if (DWObject.ErrorCode != 0) alert(DWObject.ErrorString);(DWObject.ErrorString); else //succeedelse //succeed alert("Successful");("Successful");}}
相关内容推荐:
Dynamic Web TWAIN常见问题(一):如何选择使用哪个版本br>Dynamic Web TWAIN常见问题(二):相比其他的TWAIN SDK,主要优势是什么br>Dynamic Web TWAIN常见问题(三):Dynamic Web TWAIN将使用哪些操作系统br>Dynamic Web TWAIN常见问题(四):编程问题-没有用户界面怎么工作br>Dynamic Web TWAIN常见问题(五):编程问题-如何分别设置水平和垂直分辨率br>
想要购买Dynamic Web TWAIN正版授权,或了解更多产品信息请点击【咨询在线客服】

标签:
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!