Click here to Skip to main content
Licence 
First Posted 29 May 2005
Views 129,542
Bookmarked 68 times

.NET Web Twain

By | 29 May 2005 | Article
Web twain.

Sample Image - Web_Twain.jpg

Abstract

Simply I want to use scanner in client side in DMS (Document Management System) web application. I have searched the Internet for solution but I found it very expensive for me so I decided to write a free one.

Details

I found some articles in CodeProject like .NET TWAIN image scanner By NETMaster. That's nice. That is my goal:

  1. Rewrite NETMaster's application to be in one Windows form, make it automated and find way to deploy it in web page.
  2. Call this application from your web page.
  3. Upload the acquired image to server in simple way.

step 1:nop

step 2:You can use JavaScript to do it.

<input onclick="javascript:window.open('file:///C:/TZTwain/TZTwain.exe',1);"
           type=button value=Scan>

But this code will not work with Windows XP sp2 :( So use this one:

<input onclick=runApp() type=button value="Scan XP sp2 users" name=button1>
<script language="javascript" type=text/javascript>
function runApp() 
{ 
  var shell = new ActiveXObject("WScript.shell");
  shell.run("c:\\tztwain\\tztwain.exe", 1, true); 
}
</script>

Step 3: You can use FTP or simply web service like me.

Sample App

  1. Configure testScan and FileUploadWS in IIS.
  2. FileUploadWS: Change save location.
    string filePath=Server.MapPath(@"..\testscan\upload\j2.jpg");
  3. TestScan: gives write permission to users (ASP.NET, IWAM and IUSR) at upload folder.
  4. Change web reference in testdotnettwain to localhost. Then build it and ZIP the exe file with winrar and make it sfx (with these options).
    Path=c:\tztwian\tztwain.exe
    Silent=1
    Overwrite=1) then put the tztwain.exe in c:\inetpub\wwwroot\testScan.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Taha Amin

Team Leader
http://www.linkdev.com/
Egypt Egypt

Member

B/OSS.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
Questionscan Pinmembermasumeh__5:32 7 Jan '12  
QuestionASP.net application using Twain in c# Pinmemberakul12320:40 23 Aug '11  
GeneralMy vote of 1 PinmemberAtenaShirzad0:47 21 Aug '11  
GeneralThis useless article should be removed PinmemberMember 75098520:57 5 Feb '11  
Generalask for help PinmemberMember 391195817:40 16 Jan '11  
GeneralI feel your pain.. Pinmemberbjames0221:21 18 Jul '10  
GeneralMultiPage Scaning Pinmembervikica4:01 10 Jun '09  
GeneralRe: MultiPage Scaning Pinmembervikica2:37 12 Jun '09  
GeneralRe: MultiPage Scaning Pinmemberstr_test6:53 3 Jul '10  
GeneralRe: MultiPage Scaning PinmemberTaha Amin10:36 3 Jul '10  
Generalhelp PinmemberTravis R9:39 9 Mar '09  
Generalaccess denied error Pinmemberforgoats4:03 22 Nov '08  
AnswerRe: access denied error PinmemberOffroad_011:00 12 Dec '08  
GeneralRe: access denied error Pinmemberfarrukhahmedqureshi0:55 14 May '10  
Generalit's working !! PinmemberOracle500720:33 26 Oct '08  
QuestionHey , Are You Sure This Work friend? PinmemberOracle500722:33 20 Oct '08  
QuestionMicrosoft JScript runtime error: Automation server can't create object PinmemberFahim_6220:09 13 Jun '08  
AnswerRe: Microsoft JScript runtime error: Automation server can't create object PinmemberOffroad_011:03 12 Dec '08  
GeneralRe: Microsoft JScript runtime error: Automation server can't create object PinmemberNitinMakwana23:11 9 Feb '10  
GeneralHello There Pinmemberab_dc1:39 17 Oct '07  
Generalhelp me Pinmemberpiercarmine21:35 20 Sep '07  
QuestionTo use window application in web application Pinmemberkk_upadhyay0:33 5 Sep '07  
QuestionScanning in asp.net web application Pinmemberkk_upadhyay0:26 5 Sep '07  
General[Document Scanning ] Pinmembersamshah51219:28 22 May '07  
GeneralCross browser issue PinmemberJavad Mehmood2:41 22 May '07  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web03 | 2.5.120517.1 | Last Updated 29 May 2005
Article Copyright 2005 by Taha Amin
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid