2014-12-04 55 views
0

如果我在用户界面中单击扫描后在Mozilla Firefox中运行我的代码,则会打开选择源窗口,然后崩溃。 bt相同的代码,如果我运行在铬扫描扫描仪中的图像后,如果我点击在新窗口扫描它正确扫描并在文件传输过程中崩溃和铬告诉错误消息“一个插件(shockwave闪光)不是响应“Dynamic web twain version 10.0

什么可能是概率

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

回答

0

@priya,这是瑞秋从Dynamsoft.Thanks使用我们的动态Web TWAIN SDK。您使用的是哪种版本的Firefox和Chrome?我们现在也有更新版本的Dynamic Web TWAIN,您可以尝试。请contact our support team获得更好的帮助。