canceling an ADF scan

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
andypl
Posts: 15
Joined: Fri Nov 13, 2009 5:10 pm

canceling an ADF scan

Post by andypl » Sat Dec 12, 2009 4:16 pm

If I scan a bunch of documents with ADF enabled and hit the driver's CANCEL button in the middle (on the driver's progress dialog), all the documents continue to be fed into the scanner.

Is this a limitation with the driver, or is there something I need to do to capture the cancel button?

My code...

Code: Select all

 Public Function Scan(ByVal settings As Settings, ByVal AddImageFunc As AddGDScannedImageDelegrate) As Boolean
        If (settings.generateLog) Then
            m_gd.TwainLogStart("c:\twainlog.txt")
        End If
        Dim bResult As Boolean = False
        If m_gd.TwainOpenDefaultSource(Nothing) Then
            Configure(settings)
            Do
                Dim iImageId As Integer = m_gd.TwainAcquireToGdPictureImage(Nothing)
                If iImageId <> 0 Then
                    If (Not AddImageFunc(iImageId)) Then
                        m_gd.TwainCloseSource()
                        Return False
                    End If
                End If
            Loop While m_gd.TwainGetState > TwainStatus.TWAIN_SOURCE_ENABLED
            m_gd.TwainCloseSource()
            bResult = True
        Else
            MsgBox("can't open default source, twain state is: " & m_gd.TwainGetState.ToString)
            bResult = False
        End If

        m_parent.BringToFront()
        Return bResult
    End Function

DiMa01
Posts: 3
Joined: Wed Mar 24, 2010 4:36 pm

Re: canceling an ADF scan

Post by DiMa01 » Wed Mar 24, 2010 5:33 pm

Same problem here. Scanning with

Code: Select all

            oGdPictureImaging.TwainSetAutoFeed(true);
            oGdPictureImaging.TwainSetAutoScan(true);
and pressing the cancel-button on the UI gives no reaction. The TwainState does not change until the feeder is empty. How to cancel the ADF scan?

Kind regards
Dirk

Tested version: newest (but twain.log shows "only" 641 ?)
Testing On : Windows 2008 Server (64), Windows XP (32), Windows 7 (64)
Development: Visual Studio 2008 (C#) Framework 3.5
Scanner: Innotek SCAMAX 402CD
Twain-Version: 1.1.3.1 (newest)
Attachments
Twain.zip
(3.63 KiB) Downloaded 145 times

User avatar
Loïc
Site Admin
Posts: 5706
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: canceling an ADF scan

Post by Loïc » Wed Mar 24, 2010 6:36 pm

Hi,

You should turn autoscan to off:

oGdPictureImaging.TwainSetAutoScan(false);

Hope this helps !

Loïc

DiMa01
Posts: 3
Joined: Wed Mar 24, 2010 4:36 pm

Re: canceling an ADF scan

Post by DiMa01 » Wed Mar 24, 2010 7:06 pm

Hi,

no, it doesn't help. Same problem with AutoScan off. Even if it would solve the problem the speed would then the next problem. With the AutoScan feature turned off the scanner is far to slow! I need the high speed capabilitys of the scanner and i think there should be an other way to stop the scanner.

Is there any possibility?

Kind regards
Dirk

User avatar
Loïc
Site Admin
Posts: 5706
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: canceling an ADF scan

Post by Loïc » Wed Mar 24, 2010 7:17 pm

Hi Dirk,

I ran through your log. unfortunately your TWAIN driver seems to not send the cancel request message.

What is the code you are using to scan ?

Kind regards,

Loïc

DiMa01
Posts: 3
Joined: Wed Mar 24, 2010 4:36 pm

Re: canceling an ADF scan

Post by DiMa01 » Wed Mar 24, 2010 8:10 pm

Hi Loic,

working with another twain-sdk (from v.....t) it is possible to cancel the scan. Here is the generated log. So i think it can't be the twain driver.

Kind regards
Dirk
Attachments
Twain.zip
(2.23 KiB) Downloaded 167 times

User avatar
Loïc
Site Admin
Posts: 5706
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: canceling an ADF scan

Post by Loïc » Thu Mar 25, 2010 10:00 am

Hi Dirk,

Please give me the code you are using to make the scan process.

With best regards,

Loïc

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest