Scan documents with ADF Scanner...

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
bharate.umesh
Posts: 20
Joined: Thu Dec 31, 2009 1:27 pm
Contact:

Scan documents with ADF Scanner...

Post by bharate.umesh » Thu Dec 31, 2009 4:58 pm

Hello.

I'm developing an application with VintasoftTwain.Net library 5.0.

It is working fine with FLATBED scanner. It scans document one by one.

I used the following code.

Dim oImageMemoryStream as memorystream

If bFirstImage Then
oImageMemoryStream = VSTwain.GetImageAsStream(0, ImageFileFormat.TIFF)

bFirstImage = False
Else
VSTwain.SaveImageToStream(0, oImageMemoryStream, ImageFileFormat.TIFF)

oImageMemoryStream = VSTwain.GetImageAsStream(0, ImageFileFormat.TIFF)
End If

And then it is uploaded to the FTP.

I want to know, how I upload the multiple pages with ADF scanner?

How I detect whether the Scanner is FLATBED or ADF?

And How I create a single TIFF file, if I scanned 100 pages?

Please specify the code.

Thanks,
Umesh

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Scan documents with ADF Scanner...

Post by Alex » Mon Jan 11, 2010 10:12 am

Hello Umesh,
I want to know, how I upload the multiple pages with ADF scanner?
Your code has logical mistake, here is correct code:

Code: Select all

Dim oImageMemoryStream as memorystream

If bFirstImage Then
  oImageMemoryStream = VSTwain.GetImageAsStream(0, ImageFileFormat.TIFF)
  bFirstImage = False
Else
  VSTwain.SaveImageToStream(0, oImageMemoryStream, ImageFileFormat.TIFF)
  ' Next line of code is not necessary because it removes previously saved images
  ' oImageMemoryStream = VSTwain.GetImageAsStream(0, ImageFileFormat.TIFF)
End If
How I detect whether the Scanner is FLATBED or ADF?
Please read description of the FlatbedPresent and FeederPresent properties in the documentation.
And How I create a single TIFF file, if I scanned 100 pages?
Please read the description of the SaveImage method and see this FAQ:
http://www.vintasoft.com/vstwain-dotnet ... fWithoutUi

Best regards, Alexander

bharate.umesh
Posts: 20
Joined: Thu Dec 31, 2009 1:27 pm
Contact:

Re: Scan documents with ADF Scanner...

Post by bharate.umesh » Mon Jan 11, 2010 11:00 am

Thanks Alexy.

But I have the problem, when I scanned multiple images and upload it to the FTP.

Suppose I placed 2 pages into ADF scanner, acquired it and finally upload the file to the FTP.

I get the first image scanned correctly, but the second image is the copy of first image .

Actually getting the result 2 pages with the content of the first page.

Since I'm using VintaSoftTwain.NET SDK v6.0

Please give your suggestions.

Alex
Site Admin
Posts: 1474
Joined: Thu Jul 10, 2008 2:21 pm

Re: Scan documents with ADF Scanner...

Post by Alex » Mon Jan 11, 2010 2:50 pm

I get the first image scanned correctly, but the second image is the copy of first image.
What value of the MaxImages property do you use?

You should use the code below if value of the MaxImages property is greater 1:

Code: Select all

If bFirstImage Then
  oImageMemoryStream = VSTwain.GetImageAsStream(VSTwain1.NumImages - 1, ImageFileFormat.TIFF)
  bFirstImage = False
Else
  VSTwain.SaveImageToStream(VSTwain1.NumImages - 1, oImageMemoryStream, ImageFileFormat.TIFF)
End If

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest