首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >动态web twain 10.0版

动态web twain 10.0版
EN

Stack Overflow用户
提问于 2014-12-04 14:25:19
回答 1查看 938关注 0票数 0

如果我在UI中单击scan后在mozilla firefox中运行代码,则会打开源代码窗口,然后它就会崩溃。bt相同的代码,如果我在chrome上运行它扫描扫描仪中的图像之后,如果我在新窗口上单击扫描,它会正确扫描并在文件传输期间崩溃,chrome会告诉错误消息"a plugin (shockwave flash) it responding“

可能的问题是什么

代码语言:javascript
复制
function onScan(no_of_pages)
        {
            if (DWObject)
            {
                if (DWObject.SourceCount > 0)
                {
                    DWObject.SelectSource();
                    DWObject.IfDisableSourceAfterAcquire = true;
                    DWObject.AcquireImage();
                    DWObject.MaxImagesInBuffer = no_of_pages;
                }
                else
                    alert("No TWAIN compatible drivers detected.");
            }
        }

        function Dynamsoft_ChangeConfig(config){
            config.onPrintMsg = g_DWT_PrintMsg;
        }

        function g_DWT_PrintMsg(strMessage) {
            alert(strMessage);
        }
function OnPostTransferCallback()
        {
            try{
                if(DWObject.MaxImagesInBuffer == DWObject.HowManyImagesInBuffer)
                {
                    DWObject.CloseSource();
                    sendToFlash() ;
                }else
                {
                    //TBD
                }
            }catch(err){
                alert(err.message);
            }

        }

        //Call back function from the

        function sendToFlash()
        {
            try{

                var flashMovie = window.document.flashContent;
                flashMovie.sendToActionScript(DWObject.HowManyImagesInBuffer);
                //document.getElementById("ICANSWF").sendToActionScript();
            }catch(err){

                alert(err.message);
            }
        }

        //call from flash for uploading documents

        function onUpload(serialNo)
        {
            //alert("upload the file");
            var imageArr = new Array();
            try{
                var imageName;
                var uploadPage;
                var serverHost;
                var CurrentPathName = unescape(location.pathname);  // get current PathName in plain ASCII
                var CurrentPath = CurrentPathName.substring(0, CurrentPathName.lastIndexOf("/") + 1);
                uploadPage = CurrentPath+"TempUpload.php";
                //uploadPage = CurrentPath+"UploadDocument.php";
                //serverHost = "blabla";
                //window.Plugin.HTTPPort =1451;
                serverHost = "our host";
                DWObject.HTTPPort = 80;
                DWObject.IfSSL = false;
                //alert(Plugin.HowManyImagesInBuffer);
                for(var i=0;i < DWObject.HowManyImagesInBuffer;i++)
                {
                    imageName = serialNo+"_"+(i+1)+".png";
                    DWObject.HTTPUploadThroughPost(serverHost,i,uploadPage,imageName);

                    if (DWObject.ErrorCode == 0)
                    {
                        //alert(imageName);
                        imageArr.push({"label":imageName,"source":"http://"+serverHost+":"+DWObject.HTTPPort+"/icanindonesia/AppData/Temp/"+imageName}); //Push image name and location in an array

                    }
                    else //succeded
                    {

                        alert(DWObject.ErrorString);
                        //imageArr[i] = imageName;
                        //alert(imageArr[i]);
                    }
                }
            }catch(err){
                //alert("onUpload");
                alert(err.message);
            }

            console.log(imageArr);
            return imageArr;
        }

        function startDownload(url)
        {
            //var url='.zip';
            window.open(url,'Download');
        }

        function openDocument(url){
            window.open(url, '_blank',"ican image viewer");
        }
EN

回答 1

Stack Overflow用户

发布于 2014-12-05 17:49:42

@priya,这是来自Dynamsoft.Thanks的瑞秋,感谢她使用我们的动态Web TWAIN SDK。您使用的是哪个版本的Firefox和Chrome?我们现在也有更新版本的动态Web TWAIN,您可以尝试一下。请使用contact our support team获取更好的帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27287620

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档