This project has moved. For the latest updates, please go here.

Web ASP.Net project?

Mar 21, 2014 at 3:44 PM
Is it possible to use in a Web project such as ASP.Net or SilverLight?

Mar 21, 2014 at 3:55 PM
Hello, Alexeins.
This is possible, but requires full trust to code. By now I do not have sample code for ASP.Net or Silverlight.
Mar 21, 2014 at 4:38 PM
Can we get a detailed instructions to integrate it in an existing project?
Mar 21, 2014 at 4:59 PM
Edited Mar 21, 2014 at 5:00 PM
Hello, gberr.
What type is the project? If ASP.Net or Silverlight, at the moment I can advise examples of similar commercial projects, such as this
Mar 24, 2014 at 7:00 PM
The project is in vb.NET for web, Visual Studio 2103.
Mar 24, 2014 at 7:18 PM
Hello, gberr.
Try follow example. This not Saraff.Twain.NET, but the principle is the same.
Mar 24, 2014 at 7:49 PM
May I use this in my web application (.aspx) and save it as PDF (searchable(OCR)) in my remote Web Server?
And, when PDF is created, can I add a reference field at top of the documents scanned, so when viewing the PDF user can see the reference information?
Oct 7, 2014 at 12:09 PM

I too have the same requirements. How to call this dll from a MVC application? I am new to MVC. My requirement is like show the list of scanners connected, use the properties of scanner like duplex, color, DPI change and scan the page. Upload the scanned image to server.

If anybody has code please share me or please provide some suggestions. I cannot go for licensed one.

Thanks in advance.
Oct 7, 2014 at 8:13 PM
Oct 8, 2014 at 6:50 AM
Hi Saraff,

Thanks for your reply. I am trying to work on Click Once application instead of ActiveX. I am not sure whether either one can go as solution to my need. Because, user has to install the software. This is not acceptable from the client end.

Is there any other way of doing something like calling from a web service? Is it possible? I am new to Web applications. SO please ignore if I am asking asking silly questions. Please help me in finding right approach.

Oct 8, 2014 at 4:47 PM
Hello, PrasannaRani.
Few choices: "Click Once application" and ActiveX. But in any case it must be the client-side application. Use of web services for this purpose is not possible. The main problem which will face - it's the trust of the code, because it is downloaded by browser from the Internet. User in any case have to agree to install software or configure the browser in a special way.
Nov 17, 2014 at 8:21 PM
Marked as answer by SARAFF on 11/19/2014 at 6:06 AM
Nov 27, 2014 at 1:31 PM

I have downloaded, but solution is incomplete.

Those projects have come empty:
  • Saraff.AxHost ............................ empty
  • Saraff.AxHost.Setup ............................ empty
  • Saraff.Tiff ............................ empty
  • Saraff.Twain ............................ empty
Is there something missing or should we do some additional steps?

Nov 27, 2014 at 5:04 PM
Hello, jbeteta!
See related projects: Saraff.AxHost.NET, Saraff.Tiff.NET, Saraff.Twain.NET. You need to download them.
Nov 28, 2014 at 9:06 PM
Edited Dec 16, 2014 at 2:59 PM
Thank you very much for your code. It works properly.


I had some problems when trying to run program from an URL address. By default, program only works from localhost. I realized that in JavaScript LoadScanControl() from index.htm, I should put "/" before "TwainHandler.ashx".

Command corrected:
AxHost.AddComponentParameter(AxHost.WorkingDirectory & "/TwainHandler.ashx")

Extracted code of JavaScript LoadScanControl() in index.htm:
 <script language="javascript" type="text/javascript">
      function LoadScanControl() {
      try {

          document.getElementById("LinkPDF").style.visibility = "hidden";

          if (AxHost && AxHost.object) {
              document.getElementById("req").style.display = "none";
              AxHost.WorkingDirectory = location.href.substr(0, location.href.lastIndexOf("/"));
              AxHost.ApplicationTypeName = "Saraff.Twain.WebSample.dll!Saraff.Twain.WebSample.ScanControl";
              AxHost.AddComponentParameter(AxHost.WorkingDirectory & "/TwainHandler.ashx")            
        } catch (ex) {
          alert(ex.message & "\r\nRemeber to add this site/IP to the Trusted Sites list in IE!");