Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

AcquireFinished - Allow user to scan more documents

Last post 08 Mar 2008, 6:23 AM by Glenn. 6 replies.
Sort Posts: Previous Next
  •  14 Feb 2007, 6:28 PM 11458

    AcquireFinished - Allow user to scan more documents

    Is there a way for me to continue acquiring documents from the AcquireFinished handler?  I would like to prompt the user "Scanning Complete?".  I would like for them to be able to answer "No" and scan more pages.

     Thank you!

    Karen

  •  15 Feb 2007, 6:54 PM 11466 in reply to 11458

    Re: AcquireFinished - Allow user to scan more documents

    I was able to accomplish this by adding a variable, 'acquireFinished'; initialized to false.

    I set Device.ModalAcquire = true and added a loop around Device.Acquire:
    dev.ModalAcquire;
    while (!acquireFinished)
       dev.Acquire();

    In the AcquiredFinished handler I ask the user if they are finished scanning.  If they answer yes, 'acquireFinished' is set to true and the loop is exited.  If they answer no, 'acquireFinished' is set to false and the loop is executed again.

  •  03 Mar 2008, 1:01 AM 13373 in reply to 11466

    Re: AcquireFinished - Allow user to scan more documents

    This is a really useful solution for me. However when I scan with

    Device.HideInterface = false

    I can't find a way to exit the loop if the user clicks on 'cancel' in the Scan driver dialogue. None of the Acquisition events AcquireCanceled, DeviceEvent or AcquireFinished gets fired. Is there a way for me to detect that the user has canclled from the scanner interface popup?

     

    Cheers

    Andy

  •  04 Mar 2008, 7:24 AM 13383 in reply to 13373

    Re: AcquireFinished - Allow user to scan more documents

    Andy, 

    When the cancel button on the scanner dialog is clicked, you will get an AcquireCanceled event.

    Is this a TWAIN driver or a WIA driver?  With WIA you might have issues because it doesn't follow the same rules as TWAIN.

    1. Make sure you are using the latest version of DotTwain.

    2. If you have this problem using the latest version, open a support case and provide a simple project that duplicates your problem.  Also give us the name of the driver you are testing with.


    Glenn Chittenden Jr.
    Atalasoft Development Team
  •  06 Mar 2008, 10:22 AM 13421 in reply to 13383

    Re: AcquireFinished - Allow user to scan more documents

    Thanks for the pointer Glen. Cancelling while scanning will trigger the AcquireCanceled event, however if I press cancel without having started scanning, none of the events get triggered for me to catch. I'm using a TWAIN scanner driver, and the version of DotTwain that came with Document Dot Image 4.0.

     I might investigate the newly released Dot Twain :)

     

    Cheers

    Andy

  •  08 Mar 2008, 5:54 AM 13438 in reply to 13421

    Re: AcquireFinished - Allow user to scan more documents

    I have the same trouble too. Very frustrating.

    Using dotimage 5.

    The cancel event is never fired if I press cancel without having started scanning.

     

  •  08 Mar 2008, 6:23 AM 13439 in reply to 13438

    Re: AcquireFinished - Allow user to scan more documents

    I've tested with multiple scanners and clicking the cancel button in the scanner dialog works for all of them.  For a sanity check I just tested again with 3 devices using the last release of 5.0 and they all work.

    Test your scanner with the Acquisition demo source code provided with the installer.  Put a break point in the  acquisition_AcquireCanceled method to see if it hits.  If it doesn't, then it's a problem with your driver.  You can have DotTwain create a trace log (http://www.atalasoft.com/KB/article.aspx?id=10027) to see what your driver is doing.


    Glenn Chittenden Jr.
    Atalasoft Development Team
View as RSS news feed in XML