Is there a non-activex approach to scanning documents into a web app?

冷暖自知 提交于 2019-12-11 11:06:40

问题


I am working on a web application that is a pretty simple and straightforward application except for on thing: it needs to be able to get documents from the scanner. I don't want to force the user to scan documents manually, save them, and then browse to them to upload the file, and I would like to avoid Active-X if possible (though feel free to make recommendations that include active-x). Is there a good way to do this through a web app? Can silverlight access scanners?


回答1:


You can do this with Silverlight 4.

<Button x:Name="btnAquireImage" Content="Aquire Image from Scanner/Camera" Click="btnAquireImage_Click" />


private void btnAquireImage_Click(object sender, RoutedEventArgs e)
{
   using (dynamic CommonDialog = ComAutomationFactory.CreateObject("WIA.CommonDialog"))
   {
       dynamic imageFile = CommonDialog.ShowAcquireImage();
       if (imageFile != null)
       {
           //insert file upload code
       }
   }
}

Source: http://www.brianlagunas.com/index.php/2010/02/19/silverlight-4-accessing-system-devices-with-com-interop/



来源:https://stackoverflow.com/questions/4155998/is-there-a-non-activex-approach-to-scanning-documents-into-a-web-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!