Page 1 of 1

acquiring successive images

Posted: Thu Feb 04, 2010 6:56 am
by mphilbrick
Greetings,

My application needs to "listen" for scans. Each time the user inserts a check into the scanner (Fujitsu 6130 ADF) it should automatically start the scan and save the check to a file with a unique name.

Currently I use a timer with the native transfer mode:

Code: Select all

procedure TfmCheckScan.tmFeederLoadedTimer(Sender: TObject);
begin
  tmFeederLoaded.Enabled := False;
  Application.ProcessMessages;
  if VSTwain1.FeederLoaded = 1 then
      VSTwain1.Acquire;
  else
     tmFeederLoaded.Enabled := True;
end;
I save the file and reset the timer in PostScan. Two problems -- 1) every 5 scans or so it takes over a minute for the scanner to scan, then the next scan it works fine; 2) there is a memory leak.

I would like to try AcquireModal, as it seems to be more appropriate, but I am confused as to whether it will "wait" for a document to be inserted in the scanner or if it will return an error if there is no document.

Could you provide me with a code snippet showing the preferred method for my needs? I do not need to display anything on screen and I do not want a UI. I tried setting the transfer format to File, but it will only create the first image and even though the scanner scans subsequent images, it never returned TRUE for FeederLoaded.

Re: acquiring successive images

Posted: Thu Feb 04, 2010 10:32 am
by Alex
Hello,

We need more info about your problem, please send the following information to support@vintasoft.com:
  • Code of your application, we need to see how you are starting/ending acquisition process, etc
  • Log-file generated by ActiveX, please read the documentation for info about log-file generation
Best regards, Alexander

Re: acquiring successive images

Posted: Thu Feb 04, 2010 7:51 pm
by mphilbrick
Alexander,

I will get you that information. Could you answer my question about AquireModal? If I start a while loop, will it wait until a page is placed in the feeder or will it generate an error and exit the loop if there is no page in the feeder? When I execute Acquire and a page is not in the feeder it just locks up the application. If AquireModal will "wait" until a page is loaded in the feeder, then I would like to give that a try first as it will greatly simplify my code and may rectify the problem. Thanks!

Re: acquiring successive images

Posted: Fri Feb 05, 2010 9:18 am
by Alex
Could you answer my question about AquireModal? If I start a while loop, will it wait until a page is placed in the feeder or will it generate an error and exit the loop if there is no page in the feeder?
In most cases this depends of the scanner, some scanners will show dialog "No paper", etc. Please try to use the AcquireModal method and let me know results.

Best regards, Alexander