Click here to Skip to main content
Click here to Skip to main content
Go to top

.NET Web Twain

, 29 May 2005
Rate this:
Please Sign up or sign in to vote.
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 Frown | :( 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

Share

About the Author

Taha Amin
Team Leader http://www.linkdev.com/
Egypt Egypt
B/OSS.

Comments and Discussions

 
QuestionHOW TO ACCESS AN SCANNED IMAGE FROM CLIENT SYSTEM TO SERVER. SYSTEM Pinmemberkris_bgp24-Jul-06 19:27 
AnswerRe: HOW TO ACCESS AN SCANNED IMAGE FROM CLIENT SYSTEM TO SERVER. SYSTEM PinmemberTaha Zayed24-Jul-06 22:33 
Generalexception in txtwain.exe PinmemberKHALIYA4-Jul-06 2:21 
GeneralScanner Pinmemberghannam12-Jun-06 1:42 
I do thank you. I did copy your codes under asp.net and I run the application what did. It will call the scanner dialouge and it will execute the scanning part. After it did the scan the application keep waiting and no reply took place. if you can help me and list the steps I need to do to have it save the image and take back control so I can run another scan. If possible would you kindly pass me your phone # so I can answer any question in this regard. Again I do thank you for the great job you did
GeneralNot closing application Pinmemberi0002471-Jun-06 1:25 
GeneralRe: Not closing application Pinmembermroginski3-Sep-08 4:01 
Generalscan thru asp Pinmemberxlt20-May-06 6:33 
Generalnice solution----problem with the resolution Pinmemberzhidsuk13-Feb-06 9:18 
GeneralNice ! PinmemberTareq_Gamal15-Jan-06 23:43 
Questionwhere is comments? PinmemberTaha Zayed30-May-05 23:46 

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.

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 29 May 2005
Article Copyright 2005 by Taha Amin
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid