动态网络twain版本10.0

时间:2014-12-04 06:25:19

标签: image dynamic save twain scanning

如果我在mozilla firefox中运行我的代码后,在UI中单击扫描选择源窗口打开然后它崩溃了。 bt相同的代码如果我在chrome上运行它扫描扫描仪中的图像之后如果我点击新窗口上的扫描它正确扫描并在文件传输过程中崩溃并且chrome告诉错误消息"插件(shockwave flash )没有回应"

可能是什么概率

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");
        }

1 个答案:

答案 0 :(得分:0)

@priya,这是来自Dynamsoft的Rachel。感谢使用我们的Dynamic Web TWAIN SDK。您使用的是哪个版本的Firefox和Chrome?我们现在还有更新版本的Dynamic Web TWAIN,您可以尝试。请contact our support team获得更好的帮助。