Click here to Skip to main content
Click here to Skip to main content

.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

About the Author

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

Comments and Discussions

 
GeneralIt's working fine Pinmembermkrishnan605-Sep-13 2:17 
Questionscan Pinmembermasumeh__7-Jan-12 5:32 
QuestionASP.net application using Twain in c# Pinmemberakul12323-Aug-11 20:40 
GeneralMy vote of 1 PinmemberAtenaShirzad21-Aug-11 0:47 
GeneralThis useless article should be removed PinmemberMember 7509855-Feb-11 20:57 
Generalask for help PinmemberMember 391195816-Jan-11 17:40 
GeneralI feel your pain.. Pinmemberbjames0218-Jul-10 21:21 
GeneralMultiPage Scaning Pinmembervikica10-Jun-09 4:01 
GeneralRe: MultiPage Scaning Pinmembervikica12-Jun-09 2:37 
GeneralRe: MultiPage Scaning Pinmemberstr_test3-Jul-10 6:53 
GeneralRe: MultiPage Scaning PinmemberTaha Amin3-Jul-10 10:36 
Generalhelp PinmemberTravis R9-Mar-09 9:39 
Generalaccess denied error Pinmemberforgoats22-Nov-08 4:03 
AnswerRe: access denied error PinmemberOffroad_0112-Dec-08 1:00 
GeneralRe: access denied problem Pinmember4hmeT22-Aug-12 0:56 
GeneralRe: access denied error Pinmemberfarrukhahmedqureshi14-May-10 0:55 
Generalit's working !! PinmemberOracle500726-Oct-08 20:33 
QuestionHey , Are You Sure This Work friend? PinmemberOracle500720-Oct-08 22:33 
QuestionMicrosoft JScript runtime error: Automation server can't create object PinmemberFahim_6213-Jun-08 20:09 
AnswerRe: Microsoft JScript runtime error: Automation server can't create object PinmemberOffroad_0112-Dec-08 1:03 
GeneralRe: Microsoft JScript runtime error: Automation server can't create object PinmemberNitinMakwana9-Feb-10 23:11 
GeneralHello There Pinmemberab_dc17-Oct-07 1:39 
Generalhelp me Pinmemberpiercarmine20-Sep-07 21:35 
QuestionTo use window application in web application Pinmemberkk_upadhyay5-Sep-07 0:33 
QuestionScanning in asp.net web application Pinmemberkk_upadhyay5-Sep-07 0:26 
General[Document Scanning ] Pinmembersamshah51222-May-07 19:28 
GeneralCross browser issue PinmemberJavad Mehmood22-May-07 2:41 
QuestionNo Gui PinmemberAtwal Darshan15-Feb-07 2:39 
GeneralScan Using ADF PinmemberAtwal Darshan15-Feb-07 2:33 
Questiongetting Image PinmemberPaulo Bucho20-Dec-06 1:47 
GeneralDetection problem Pinmemberajlaluan25-Aug-06 17:51 
GeneralRe: Detection problem [modified] PinmemberTaha Zayed26-Aug-06 5:51 
GeneralRe: Detection problem [modified] Pinmemberajlaluan26-Aug-06 22:52 
GeneralShell Pinmemberzhinoos23-Aug-06 22:41 
GeneralAutomation server can't PinmemberCalito26-Jul-06 7:54 
AnswerRe: Automation server can't create object PinmemberOffroad_0112-Dec-08 0:25 
GeneralRe: Automation server can't create object PinmemberSafiuddin Ansari23-Sep-09 1:51 
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 
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 
Hello Taha , I'm Tare gamal from egypt , I hope i see all egyptians like u,
any how Perfect artical , I am reading your one about web cam and motion detiction because i'd like to make a security system at home Wink | ;)
 
Wellcome
Questionwhere is comments? PinmemberTaha Zayed30-May-05 23:46 
AnswerRe: where is comments? PinmemberLaMagra31-May-05 21:52 
GeneralRe: where is comments? PinmemberMaxJam1-Jun-05 0:35 

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
Web01 | 2.8.140721.1 | Last Updated 29 May 2005
Article Copyright 2005 by Taha Amin
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid