Twain acquisition
Twain acquisition
I wrote 3 functions with the following functionality:
Function1 opens the default source: oImaging.TwainOpenDefaultSource(this.Handle);
Function2 executes oImaging.TwainAcquireToGdPictureImage(this.Handle); in a loop until a 0 is returned (no paper anymore in the scanner)
Function 3 closes the twain source: oImaging.TwainCloseSource();
These are very simple functions.
After function1 is called, I call function2 to scan the paper in the scanner. When all is scanned, I put more paper in the scanner and
call function2 again. Now nothing happens. TwainAcquireToGdPictureImage always returns 0. Only if function1 is called again, function2 works.
Why?
Please advise.
I am running GdPicture version 6,6001
Eagleman
Function1 opens the default source: oImaging.TwainOpenDefaultSource(this.Handle);
Function2 executes oImaging.TwainAcquireToGdPictureImage(this.Handle); in a loop until a 0 is returned (no paper anymore in the scanner)
Function 3 closes the twain source: oImaging.TwainCloseSource();
These are very simple functions.
After function1 is called, I call function2 to scan the paper in the scanner. When all is scanned, I put more paper in the scanner and
call function2 again. Now nothing happens. TwainAcquireToGdPictureImage always returns 0. Only if function1 is called again, function2 works.
Why?
Please advise.
I am running GdPicture version 6,6001
Eagleman
Re: Twain acquisition
Hi,
We are already investigating on this kind of problem since few days.
I think you can fix quickly your problem using TwainUnloadSourceManager instead of TwainCloseSource.
If your problem persists, please give us the needed information to help you. See: viewtopic.php?t=1486
With best regards,
Loïc
We are already investigating on this kind of problem since few days.
I think you can fix quickly your problem using TwainUnloadSourceManager instead of TwainCloseSource.
If your problem persists, please give us the needed information to help you. See: viewtopic.php?t=1486
With best regards,
Loïc
Re: Twain acquisition
Loïc,
There is no problem with TwainCloseSource.
The problem is that after scanning all paper from the scanner, I cannot scan again. I have to call TwainOpenDefaultSource before i can scan again.
eagleman
There is no problem with TwainCloseSource.
The problem is that after scanning all paper from the scanner, I cannot scan again. I have to call TwainOpenDefaultSource before i can scan again.
eagleman
Re: Twain acquisition
Hi,
In all case if you want more investigation from our side, please follow the steps explained here: viewtopic.php?t=1486
Kind regards,
Loïc
Some scanners need to be closed after a scan process. it is probably your case.The problem is that after scanning all paper from the scanner, I cannot scan again
In all case if you want more investigation from our side, please follow the steps explained here: viewtopic.php?t=1486
Kind regards,
Loïc
Re: Twain acquisition
Another hint: Call TwainSetAutoSourceClose(False) before your scan process.
Loïc
Loïc
Re: Twain acquisition
Loïc,
TwainSetAutoSourceClose(false) did the trick. Now it works as expected.
However, shouldn't the AutoSourceClose be false by default?
It is logical to think that a scanning process looks like:
OpenSource
Scan..(some papers)
Scan..(some more papers)
Scan..
Scan..
Scan..
CloseSource
Nevertheless, thanks for taking the time to find a solution to our problems.
eagleman
TwainSetAutoSourceClose(false) did the trick. Now it works as expected.
However, shouldn't the AutoSourceClose be false by default?
It is logical to think that a scanning process looks like:
OpenSource
Scan..(some papers)
Scan..(some more papers)
Scan..
Scan..
Scan..
CloseSource
Nevertheless, thanks for taking the time to find a solution to our problems.
eagleman
Re: Twain acquisition
Hi,
We set it to True by default because some scanner doesn't support to stay in open state after a scan process.
Kind regards,
Loïc
It is the question !However, shouldn't the AutoSourceClose be false by default?
We set it to True by default because some scanner doesn't support to stay in open state after a scan process.
Kind regards,
Loïc
Re: Twain acquisition
You are right: that is THE question.
Thanks for your help.
eagleman
Thanks for your help.
eagleman
Who is online
Users browsing this forum: No registered users and 1 guest