Click here to Skip to main content
11,711,220 members (86,572 online)
Click here to Skip to main content

.NET Web Twain

, 29 May 2005 193.9K 14.5K 74
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
Architect http://www.linkdev.com/
Egypt Egypt
Senior Development Manager, with 11 years of experience. Focused on design/developing/delivery B/OSS modules to satisfy customer/business requirements in accordance to TM Forum's TAM/SID framework. Excellent communication and interpersonal skills, flexibility, ability to adjust to new people and situations, strong problem solving skills and willing to work effectively and efficiently. Gained additional leadership skills such as: - High effective mentorship and coaching - Clearly communication and solutions sharing with my team - Decision making

You may also be interested in...

Comments and Discussions

 
SuggestionUse a 3rd party TWAIN ActiveX / Plugin for easier or quicker deployment Pin
Windy Liu13-Oct-14 20:08
memberWindy Liu13-Oct-14 20:08 
GeneralIt's working fine Pin
mkrishnan605-Sep-13 2:17
membermkrishnan605-Sep-13 2:17 
GeneralRe: It's working fine Pin
sandeep7589-Dec-14 6:09
membersandeep7589-Dec-14 6:09 
Questionscan Pin
masumeh__7-Jan-12 5:32
membermasumeh__7-Jan-12 5:32 
QuestionASP.net application using Twain in c# Pin
akul12323-Aug-11 20:40
memberakul12323-Aug-11 20:40 
GeneralMy vote of 1 Pin
AtenaShirzad21-Aug-11 0:47
memberAtenaShirzad21-Aug-11 0:47 
GeneralThis useless article should be removed Pin
Member 7509855-Feb-11 20:57
memberMember 7509855-Feb-11 20:57 
Generalask for help Pin
Member 391195816-Jan-11 17:40
memberMember 391195816-Jan-11 17:40 
GeneralI feel your pain.. Pin
bjames0218-Jul-10 21:21
memberbjames0218-Jul-10 21:21 
GeneralMultiPage Scaning Pin
vikica10-Jun-09 4:01
membervikica10-Jun-09 4:01 
can u please help me how to modify your code to make it work for multi page scaning. Like this ArrayList pics returns count 1.
GeneralRe: MultiPage Scaning Pin
vikica12-Jun-09 2:37
membervikica12-Jun-09 2:37 
GeneralRe: MultiPage Scaning Pin
str_test3-Jul-10 6:53
memberstr_test3-Jul-10 6:53 
GeneralRe: MultiPage Scaning Pin
Taha Amin3-Jul-10 10:36
memberTaha Amin3-Jul-10 10:36 
Generalhelp Pin
Travis R9-Mar-09 9:39
memberTravis R9-Mar-09 9:39 
Generalaccess denied error Pin
forgoats22-Nov-08 4:03
memberforgoats22-Nov-08 4:03 
AnswerRe: access denied error Pin
Offroad_0112-Dec-08 1:00
memberOffroad_0112-Dec-08 1:00 
GeneralRe: access denied problem Pin
4hmeT22-Aug-12 0:56
member4hmeT22-Aug-12 0:56 
GeneralRe: access denied problem Pin
sandeep75810-Dec-14 15:31
membersandeep75810-Dec-14 15:31 
GeneralRe: access denied error Pin
farrukhahmedqureshi14-May-10 0:55
memberfarrukhahmedqureshi14-May-10 0:55 
Generalit's working !! Pin
Oracle500726-Oct-08 20:33
memberOracle500726-Oct-08 20:33 
QuestionHey , Are You Sure This Work friend? Pin
Oracle500720-Oct-08 22:33
memberOracle500720-Oct-08 22:33 
QuestionMicrosoft JScript runtime error: Automation server can't create object Pin
Fahim_6213-Jun-08 20:09
memberFahim_6213-Jun-08 20:09 
AnswerRe: Microsoft JScript runtime error: Automation server can't create object Pin
Offroad_0112-Dec-08 1:03
memberOffroad_0112-Dec-08 1:03 
GeneralRe: Microsoft JScript runtime error: Automation server can't create object Pin
NitinMakwana9-Feb-10 23:11
memberNitinMakwana9-Feb-10 23:11 
AnswerRe: Microsoft JScript runtime error: Automation server can't create object Pin
Member 1187391330-Jul-15 3:31
memberMember 1187391330-Jul-15 3:31 
GeneralHello There Pin
ab_dc17-Oct-07 1:39
memberab_dc17-Oct-07 1:39 
Generalhelp me Pin
piercarmine20-Sep-07 21:35
memberpiercarmine20-Sep-07 21:35 
QuestionTo use window application in web application Pin
kk_upadhyay5-Sep-07 0:33
memberkk_upadhyay5-Sep-07 0:33 
QuestionScanning in asp.net web application Pin
kk_upadhyay5-Sep-07 0:26
memberkk_upadhyay5-Sep-07 0:26 
General[Document Scanning ] Pin
samshah51222-May-07 19:28
membersamshah51222-May-07 19:28 
GeneralCross browser issue Pin
Javad Mehmood22-May-07 2:41
memberJavad Mehmood22-May-07 2:41 
QuestionNo Gui Pin
Atwal Darshan15-Feb-07 2:39
memberAtwal Darshan15-Feb-07 2:39 
GeneralScan Using ADF Pin
Atwal Darshan15-Feb-07 2:33
memberAtwal Darshan15-Feb-07 2:33 
Questiongetting Image Pin
Paulo Bucho20-Dec-06 1:47
memberPaulo Bucho20-Dec-06 1:47 
GeneralDetection problem Pin
ajlaluan25-Aug-06 17:51
memberajlaluan25-Aug-06 17:51 
GeneralRe: Detection problem [modified] Pin
Taha Zayed26-Aug-06 5:51
memberTaha Zayed26-Aug-06 5:51 
GeneralRe: Detection problem [modified] Pin
ajlaluan26-Aug-06 22:52
memberajlaluan26-Aug-06 22:52 
GeneralShell Pin
zhinoos23-Aug-06 22:41
memberzhinoos23-Aug-06 22:41 
GeneralAutomation server can't Pin
Calito26-Jul-06 7:54
memberCalito26-Jul-06 7:54 
AnswerRe: Automation server can't create object Pin
Offroad_0112-Dec-08 0:25
memberOffroad_0112-Dec-08 0:25 
GeneralRe: Automation server can't create object Pin
Safiuddin Ansari23-Sep-09 1:51
memberSafiuddin Ansari23-Sep-09 1:51 
QuestionHOW TO ACCESS AN SCANNED IMAGE FROM CLIENT SYSTEM TO SERVER. SYSTEM Pin
kris_bgp24-Jul-06 19:27
memberkris_bgp24-Jul-06 19:27 
AnswerRe: HOW TO ACCESS AN SCANNED IMAGE FROM CLIENT SYSTEM TO SERVER. SYSTEM Pin
Taha Zayed24-Jul-06 22:33
memberTaha Zayed24-Jul-06 22:33 
Generalexception in txtwain.exe Pin
KHALIYA4-Jul-06 2:21
memberKHALIYA4-Jul-06 2:21 
GeneralScanner Pin
ghannam12-Jun-06 1:42
memberghannam12-Jun-06 1:42 
GeneralNot closing application Pin
i0002471-Jun-06 1:25
memberi0002471-Jun-06 1:25 
GeneralRe: Not closing application Pin
mroginski3-Sep-08 4:01
membermroginski3-Sep-08 4:01 
Generalscan thru asp Pin
xlt20-May-06 6:33
memberxlt20-May-06 6:33 
Generalnice solution----problem with the resolution Pin
zhidsuk13-Feb-06 9:18
memberzhidsuk13-Feb-06 9:18 
GeneralNice ! Pin
Tareq_Gamal15-Jan-06 23:43
memberTareq_Gamal15-Jan-06 23:43 

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