AutoFeed question

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

Moderator: Alex

Post Reply
bmihai
Posts: 4
Joined: Thu Jul 24, 2008 4:09 pm

AutoFeed question

Post by bmihai »

I have a scanner with AutoFeeder and i want to know how can i stop scanning after 10 pages. Like when i hit the Stop AFD button.I've tried AutoFeed and FeederEnabled set to false but the scanner keeps feeding.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: AutoFeed question

Post by Alex »

Hello Mihai,

If you want to stop images acquisition process you should set value of the CancelTransfer property to true.
When value of this property is set to true:
1. The current scan process will be finished and currently acquired image will not be placed in the images buffer.
2. Acquisition process will be stopped when the ScanCompleted event will be fired.

--
Best regards, Alexander
bmihai
Posts: 4
Joined: Thu Jul 24, 2008 4:09 pm

Re: AutoFeed question

Post by bmihai »

I've tried with CancelTransfer, the problems seems to be that there is some kind of lag between the actual pass though the scanner and the launch of the ImageAcquired event, because the scanner manages to feed 2 extra papers. If my limit is 10, i will have 10 images in the buffer, but there would be 12 papers which would have gone through the scanner.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: AutoFeed question

Post by Alex »

Here is a sample code:

Code: Select all

  Private Sub VSTwain1_ImageAcquired(ByVal sender As Object, _
                ByVal e As System.EventArgs) Handles VSTwain1.ImageAcquired
    ...
    If acquiredImagesCounter = 10 Then
      VSTwain1.CancelTransfer = True
    End If
    ...
  End Sub
bmihai
Posts: 4
Joined: Thu Jul 24, 2008 4:09 pm

Re: AutoFeed question

Post by bmihai »

That's the exact same thing that i did, but the autofeeder manages to feed 2 extra papers, but i've found the Xfercount property, which is more or less the solution to my problem. Thank you for your input.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: AutoFeed question

Post by Alex »

Yes, it's a good solution but only if you know how many images do you want to scan. We can send a debug version of library to you - log-file from debug version will allow us to understand the problem more clearly. What do you think?
bmihai
Posts: 4
Joined: Thu Jul 24, 2008 4:09 pm

Re: AutoFeed question

Post by bmihai »

If you think it may aid you in your future development, sure.Tell me how do you want to make contact.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: AutoFeed question

Post by Alex »

I have sent the debug version of library to you via email.
Alex
Site Admin
Posts: 2305
Joined: Thu Jul 10, 2008 2:21 pm

Re: AutoFeed question

Post by Alex »

It's a correct work of scanner. You have enabled AutoFeed feature so the scanner tries to acquire all images from the feeder. Scanner stores acquired images in his internal buffer and sends images one by one to application.
Post Reply