Canceling Scan

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

Moderator: Alex

Post Reply
SLNichols1124
Posts: 4
Joined: Thu Oct 09, 2008 11:06 pm

Canceling Scan

Post by SLNichols1124 » Thu Oct 09, 2008 11:07 pm

How do I cancel a scanning process using an autofeeder, so that a user can stop scanning at anytime?

Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

Re: Canceling Scan

Post by Alex » Fri Oct 10, 2008 1:12 pm

Hello,

You should make the following steps if you want to cancel the images acqisition process correctly:
1. Set the CancelTransfer property to True.
2. Wait for the ScanCompleted event if you acquire images asynchronously.
3. Wait for a False value from the AcquireModal method if you acquire images in modal loop.

Here is a work algorithm of slow scanners:
1. Scanner acquires the page, sends the page to the application and waits for the message from the application in modal loop.
2. Application processes the page and sends message to the scanner that the page is processed and application is ready to receive new page.
3. Scanner receives message from the application.
4. Scanner checks ADF and sends message that image acquisition process is finished to the application if ADF does not have any pages.
5. Scanner checks ADF and acquires new page (go to the step 1) if ADF has any pages.

And here is a work algorithm of high-speed scanners which have internal buffers:
1. Scanner acquires the page, sends the page to the application and waits for the message from the application asynchronously.
2. Application processes the page and sends message to the scanner that the page is processed and application is ready to receive new page.
3. Scanner acquires pages till internal buffer is not filled.
4. Scanner receives message from the application.
5. Scanner checks internal buffer and sends the page from the internal buffer if buffer has pages
6. Scanner checkes ADF and sends message that image acquisition process is finished to the application if ADF does not have any pages.
7. Scanner checks ADF and acquires new page (go to the step 1) if ADF has any pages.

So the following situation is possible: you cancel image acquisition process and your application acquires 10 pages but scanner processes 12 pages from ADF. This is not a bug. This happened because you enabled the auto feed feature of the high-speed scanner.

Please read the documentation of the product for more info.

Best regards, Alexander

rahulasanikar
Posts: 1
Joined: Fri Sep 17, 2010 5:11 pm

Re: Canceling Scan

Post by rahulasanikar » Fri Sep 17, 2010 5:16 pm

This is an old post. Is the canceltransfer property changed to device.canceltransfer() function?

Also, I am using filetransfer mode which has same issue, when I call device.canceltransfer() function anytime during a batch scan, scanner processes 2 additional pages but acquire sends images excluding last 2.

I am sure this seems to be a bug or we are not calling the functions correctly. Any updates due to new versions of SDK?

Alex
Site Admin
Posts: 1462
Joined: Thu Jul 10, 2008 2:21 pm

Re: Canceling Scan

Post by Alex » Tue Sep 21, 2010 1:18 pm

Hello,
This is an old post. Is the canceltransfer property changed to device.canceltransfer() function?
Yes, please read description of the Device.CancelTransfer() method in the documentation.

Also please read "Cancel Image Acquisition" topic in "Programming" section of the documentation.

Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests