Contact us


All times are UTC - 8 hours



Post new topic Reply to topic  [ 5 posts ] 
Author Message
Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
I'd like to set IfShowUI to false and get the user to select whether they wish to capture an image from the flatbed device or the auto document feeder (if the latter is supported by the user's scanner). I can set this with:

dynamicDotNetTwain.IfFeederEnabled = True

If the user selects to capture images from the auto document feeder (ADF), I want to check whether the scanner being used has an ADF and supports capturing images by this means. If the scanner doesn't have an ADF, I want to alert the user, abort the scan process and force them to select the flatbed option and try again. I am confused as to which properties to query to achieve this.

Does IfAutoFeed return True if the selected scanner device has an ADF and False if it doesn't?

Does IfFeederLoaded return True if the ADF is not loaded with paper and False either if it is not loaded with paper or if the scanner doesn't have an ADF?

Does the following code correctly achieve what I want?

If cboSourceMethod.Text = "Flatbed scanner" Then

dynamicDotNetTwain.IfFeederEnabled = True

ElseIf cboSourceMethod.Text = "Auto document feeder" Then

dynamicDotNetTwain.IfFeederEnabled = False

End If

If dynamicDotNetTwain.IfFeederEnabled = True Then

If dynamicDotNetTwain.IfAutoFeed = False Then

MessageBox.Show "Scanner does not support capture via ADF"

Return

End If

If dynamicDotNetTwain.IfFeederLoaded = True Then

dynamicDotNetTwain.AcquireImage

Else

MessageBox.Show "There is no paper loaded in the ADF"

End If

Else

dynamicDotNetTwain.AcquireImage

End If


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1701
Hi Matty,

1. You only need to use IfFeederEnable to check if the current selected device has ADF feature. For example,

Code:
dynamicDotNetTwain.IfFeederEnabled = true

If dynamicDotNetTwain.IfFeederEnabled = False Then
MessageBox.Show "Scanner does not support capture via ADF"


2. Detecting whether paper is loaded in the feeder requires that the device has paper sensor available. You can use IfPaperDetectable API to verify it. If paper is detectable, then you can use IfFeederLoaded to see if the automatic feeder is now loaded with paper(s).

Code:
If dynamicDotNetTwain.IfPaperDetectable = True Then
 If dynamicDotNetTwain.IfFeederLoaded = False
    MessageBox.Show "There is no paper loaded in the ADF"


Thanks,

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
So does IfPaperDetectable return True if the scanner has paper sensors and False if it does not?

and

Is the value of IfFeederLoaded only meaningful if IfPaperDetectable returns True?


Offline Profile  


Joined: Wed May 21, 2014 3:38 am
Posts: 19
Further to my previous post, I notice that there is a capability item CAP_PAPERDETECTABLE. Is the use of this preferred over the use of the properties mentioned previously? If so, would the following function provide information on whether the selected scanner has a paper sensor to detect whether paper is loaded into the ADF:

Code:
Private Function ScannerHasPaperSensor() As Boolean
Twain.OpenSource()
Twain.Capability = Dynamsoft.DotNet.TWAIN.Enums.TWCapability.CAP_PAPERDETECTABLE
Twain.CapType = Dynamsoft.DotNet.TWAIN.Enums.TWCapType.TWON_ONEVALUE
Twain.CapValue = 1
Return Convert.ToBoolean(Twain.CapSet())
End Function


User avatar
Offline Profile  


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1701
Matty wrote:
So does IfPaperDetectable return True if the scanner has paper sensors and False if it does not?

and

Is the value of IfFeederLoaded only meaningful if IfPaperDetectable returns True?


Both the answers are yes. So you should make sure your scanner has the sensors to detect the paper.

As for the code, I think it will realize the function to detect the sensor and then you can add a function to determine whether the paper is loaded.

However, we encapsulated this capability code and worked out the IfPaperDetectable API. Thus, you can use either one to serve the same purpose.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ]  Moderators: Michael, Vincy


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Copyright © 2016 Dynamsoft | All Rights Reserved
dynamic designed by Dynamsoft team