read multiple pages from adf scanner
read multiple pages from adf scanner
Hi,
how can I read multiple pages from scanner with ADF?
Is there a sample?
Thank you for your support.
Regards
Ulli
how can I read multiple pages from scanner with ADF?
Is there a sample?
Thank you for your support.
Regards
Ulli
Hi,
if you download the full package you will get many samples in several languages.
You can access too to the online GdTwain samples from this link: https://gdpicture.com/samples/gdtwain-tw ... amples.php
Best regards,
Loïc
if you download the full package you will get many samples in several languages.
You can access too to the online GdTwain samples from this link: https://gdpicture.com/samples/gdtwain-tw ... amples.php
Best regards,
Loïc
Hi,
thank you for your support.
It works, but how can I avaoid that the twain source gets closed right away?
I am using following code (Visual FoxPro):
WITH THISFORM
IF VARTYPE(.oTwain)='O'
llStoreToFile = (.chkToJPGFile.VALUE .OR. .chkToPDFFile.VALUE)
llTwainUI = .chkSetup.VALUE
.oTwain.TwainSetHideUI(!llTwainUI)
.oTwain.TwainSetAutoFeed(.T.)
.oTwain.TwainSetAutoScan(.T.)
.oTwain.TwainSetIndicators (.F.)
lnImageCnt = 0
DO WHILE .T.
lnImageID = .oTwain.CreateImageFromTwain(APPLICATION.HWND)
IF lnImageID<>0
lnImageID = .oTwain.GetNativeImage()
lnImageCnt = lnImageCnt+1
IF lnImageCnt=1
.oTwain.TiffSaveAsNativeMultipage ('test1.tif',2)
ELSE
.oTwain.TiffAddToNativeMultipage (lnImageID)
.oTwain.CloseImage(lnImageID)
ENDIF
ELSE
EXIT
ENDIF
ENDDO
.oTwain.TiffCloseNativeMultiPage()
ENDIF
lnState = .oTwain.TwainGetState()
IF lnState<4
WAIT WINDOW 'Twain gets started...' NOWAIT
.oTwain.TwainOpenDefaultSource()
WAIT CLEAR
ENDIF
WAIT WINDOW 'SCAN finished' TIMEOUT 1
ENDWITH
thank you for your support.
It works, but how can I avaoid that the twain source gets closed right away?
I am using following code (Visual FoxPro):
WITH THISFORM
IF VARTYPE(.oTwain)='O'
llStoreToFile = (.chkToJPGFile.VALUE .OR. .chkToPDFFile.VALUE)
llTwainUI = .chkSetup.VALUE
.oTwain.TwainSetHideUI(!llTwainUI)
.oTwain.TwainSetAutoFeed(.T.)
.oTwain.TwainSetAutoScan(.T.)
.oTwain.TwainSetIndicators (.F.)
lnImageCnt = 0
DO WHILE .T.
lnImageID = .oTwain.CreateImageFromTwain(APPLICATION.HWND)
IF lnImageID<>0
lnImageID = .oTwain.GetNativeImage()
lnImageCnt = lnImageCnt+1
IF lnImageCnt=1
.oTwain.TiffSaveAsNativeMultipage ('test1.tif',2)
ELSE
.oTwain.TiffAddToNativeMultipage (lnImageID)
.oTwain.CloseImage(lnImageID)
ENDIF
ELSE
EXIT
ENDIF
ENDDO
.oTwain.TiffCloseNativeMultiPage()
ENDIF
lnState = .oTwain.TwainGetState()
IF lnState<4
WAIT WINDOW 'Twain gets started...' NOWAIT
.oTwain.TwainOpenDefaultSource()
WAIT CLEAR
ENDIF
WAIT WINDOW 'SCAN finished' TIMEOUT 1
ENDWITH
Excellent question !It works, but how can I avaoid that the twain source gets closed right away?
With the current edition, at the end of an acquisition process unsing autofeed mode, the source is always closed.
For the next edition I will add a TwainDisableAutoSourceClose() method to avoid the source closed after a scan process.
This edition will be available the next week.
Best regards,
Loïc Carrère
twain1.TwainDisableAutoSourceClose(True)
Testing your VB.net 2005 included example program, I could only get my fujitsu scanner to scan more than one sheet of paper per job if I allowed the scanner user interface to open. This only worked on the first scan job. Subsequent scan jobs only take one sheet of paper and stop.
I tried adding the following line of code to Demo3 to try and make it actually scan more than one sheet of paper.
twain1.TwainDisableAutoSourceClose(True)
Calling twain1.TwainDisableAutoSourceClose(True) in VB.Net 2005 produces the following error.
"The runtime has encountered a fatal error. The address of the error was at 0x79f36793, on thread 0x144c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack. "
There seems to be a bug in this code. Any suggestions?
I tried adding the following line of code to Demo3 to try and make it actually scan more than one sheet of paper.
twain1.TwainDisableAutoSourceClose(True)
Calling twain1.TwainDisableAutoSourceClose(True) in VB.Net 2005 produces the following error.
"The runtime has encountered a fatal error. The address of the error was at 0x79f36793, on thread 0x144c. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack. "
There seems to be a bug in this code. Any suggestions?
You are right, it was a bug into the gdtwain.dll library.
A fix has done.
Please update your component from here: https://www.gdpicture.com/download.php
Regards,
Loïc
A fix has done.
Please update your component from here: https://www.gdpicture.com/download.php
Regards,
Loïc
AutoFeed Failure
That fixed that command.
Thank you! This OCX looks very promising for my needs. Thank you for your quick response!!
AutoFeed of multipage documents still fails. It works the first time but not thereafter. Before the first scan twain1.TwainIsAutoFeedOn() returns true, but thereafter false.
Attempting to turn on autofeed using twain1.TwainSetAutoFeed(True) returns true but testing twain1.TwainIsAutoFeedOn() returns false immediately after.
twain1.TwainSetAutoScan(True) does not work.
Is there a way to fix this??
Thank you again!
Thank you! This OCX looks very promising for my needs. Thank you for your quick response!!
AutoFeed of multipage documents still fails. It works the first time but not thereafter. Before the first scan twain1.TwainIsAutoFeedOn() returns true, but thereafter false.
Attempting to turn on autofeed using twain1.TwainSetAutoFeed(True) returns true but testing twain1.TwainIsAutoFeedOn() returns false immediately after.
twain1.TwainSetAutoScan(True) does not work.
Is there a way to fix this??
Thank you again!
Next of this topic here: http://www.forums.gdpicture.com/auto-do ... -t251.html
Who is online
Users browsing this forum: No registered users and 1 guest