傳統的掃描儀都是須要經過USB鏈接到PC上使用的。若是多人共用掃描儀,好比辦公室裏,須要常常插拔,更換PC,安裝驅動,很是麻煩。如今搭載Android系統的智能掃描儀已經出現了,用戶能夠很方便的經過網絡無線掃描。那麼有什麼辦法讓舊的掃描儀也智能化?使用35刀的樹莓派能夠提供一種廉價的解決方案 - 把掃描儀鏈接到樹莓派上,經過樹莓派控制掃描儀,並經過網絡傳輸數據。這樣就不須要花不少錢去購買新的掃描儀了。javascript
這是一套使用Dynamic Web TWAIN樹莓派版本的解決方案。html
下載安裝包。java
安裝:git
sudo dpkg -i dynamic_web_twain-arm-trial.deb
刪除:github
sudo dpkg -r dynamsoft-webtwain-service
var remoteIP = "192.168.8.51";
Dynamsoft.WebTwainEnv.AutoLoad = false;
Dynamsoft.WebTwainEnv.ProductKey = "";
var HTTP_PORT = 18618; var HTTPS_PORT = 18619; window.onload = function() { Dynamsoft.WebTwainEnv.CreateDWTObject('dwtObjectContainer', remoteIP, HTTP_PORT, HTTPS_PORT, function(obj) { DWObject = obj; DWObject.Width = 270; DWObject.Height = 350; console.log('DWTObject created.'); if (DWObject) { var count = DWObject.SourceCount; if (count == 0 && Dynamsoft.Lib.env.bMac) { DWObject.CloseSourceManager(); DWObject.ImageCaptureDriverType = 0; DWObject.OpenSourceManager(); count = DWObject.SourceCount; } for (var i = 0; i < count; i++) document.getElementById("source").options.add(new Option(DWObject.GetSourceNameItems(i), i)); // Get Data Source names from Data Source Manager and put them in a drop-down box } }, function(es) { console.log(es); }); };
function AcquireImage() { if (DWObject) { var OnAcquireImageSuccess, OnAcquireImageFailure; OnAcquireImageSuccess = OnAcquireImageFailure = function() { DWObject.CloseSource(); }; DWObject.SelectSourceByIndex(document.getElementById("source").selectedIndex); //Use method SelectSourceByIndex to avoid the 'Select Source' dialog DWObject.OpenSource(); DWObject.IfDisableSourceAfterAcquire = true; // Scanner source will be disabled/closed automatically after the scan. DWObject.AcquireImage(OnAcquireImageSuccess, OnAcquireImageFailure); } }
https://v.qq.com/x/page/r0341rlc3et.htmlweb
https://github.com/dynamsoftlabs/raspberrypi-document-scanning瀏覽器