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 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.