2014-12-04 60 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獲得更好的幫助。