Page 1 of 1

AutoFeed question

Posted: Thu Jul 24, 2008 4:12 pm
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.

Re: AutoFeed question

Posted: Thu Jul 24, 2008 5:51 pm
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

Re: AutoFeed question

Posted: Thu Jul 24, 2008 6:33 pm
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.

Re: AutoFeed question

Posted: Thu Jul 24, 2008 6:43 pm
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

Re: AutoFeed question

Posted: Fri Jul 25, 2008 11:26 am
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.

Re: AutoFeed question

Posted: Fri Jul 25, 2008 3:18 pm
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?

Re: AutoFeed question

Posted: Mon Jul 28, 2008 12:40 pm
by bmihai
If you think it may aid you in your future development, sure.Tell me how do you want to make contact.

Re: AutoFeed question

Posted: Mon Jul 28, 2008 1:38 pm
by Alex
I have sent the debug version of library to you via email.

Re: AutoFeed question

Posted: Wed Aug 06, 2008 10:09 am
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.