Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, September 16, 2009 4:30:56 AM(UTC)
christo_1983

Groups: Registered
Posts: 13


Hi support team,

             I am using LeadTools 16.5.  When Acquiring images the Configuration of the scanner like Scanning Option(singlePage,ScanAhead),Feeding Option is selected in the ComboBox.

    The settings of the scanner such as single page,multi page,pagesize has to be given in code.

Kindly provide me code for giving the scanner settings through code.

  

 

 

 

 

 

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, September 16, 2009 11:18:33 PM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

What is the LEADTOOLS programming interface (C DLL, .Net Classes, C++ Class Library, etc.) that you use?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#3 Posted : Thursday, September 17, 2009 1:31:55 AM(UTC)
christo_1983

Groups: Registered
Posts: 13


.Net Classes

               I am using DotNet.

 

 

 

 

 

 

 

 

 
#4 Posted : Thursday, September 17, 2009 4:14:19 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

For Single page, Use the SetCapability Method and set the capability corresponding to TwainCapabilityType.TransferCount (CAP_XFERCOUNT Twain capability) to 1.
For multi-page, set it to a value greater than 1 or set it to -1 (minus one) to scan all pages in the feeder.

Also use the SetCapability Method and select the desired paper size using the TwainCapabilityType.ImageSupportedSizes capability (ICAP_SUPPORTEDSIZES).

For more details about the ICAP_SUPPORTEDSIZES and CAP_XFERCOUNT settings, please refer to the Twain specification document from the Twain working group.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#5 Posted : Friday, September 18, 2009 11:33:26 PM(UTC)
christo_1983

Groups: Registered
Posts: 13


 

Kindly provide me some sample codings for configuring the above Settings. I am using LeadTools 16.5. It will be useful if the sample codings are in Dot Net. 

 

 
#6 Posted : Monday, September 21, 2009 3:58:00 PM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

Hello,

For more information about using options in Twain, please see the help file topic "Getting and Setting Capabilities" in the .NET help file (http://www.leadtools.com/Help/LEADTOOLS/v16/DH/TO/Leadtools.Topics~Leadtools.Topics.GettingAndSettingCapabilities.html). You can also see specific examples on how to get and set capabilities in the listings for TWainSession.GetCapability and TwainSession.SetCapability. You can navigate to these through the above link.

For a specific example relating to setting the TransferCount with SetCapability, please see the following posting:
http://support.leadtools.com/SupportPortal/CS/forums/30439/ShowPost.aspx
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#7 Posted : Sunday, September 27, 2009 1:04:00 AM(UTC)
christo_1983

Groups: Registered
Posts: 13


Thanks for the code.

                Similarly i want to set other configurations of scanner through code.

         Configurations that i need to set is paper size, Mode,DPI,Feeding option.

I want the sample source in dotnet.I have installed leadtools 16.5 in my machine. 

 
#8 Posted : Monday, September 28, 2009 1:55:49 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

(1) For paper size, you need to set the ICAP_SUPPORTEDSIZES capability as follows:

' ICAP_SUPPORTEDSIZES
twCap.Information.Type = TwainCapabilityType.ImageSupportedSizes
twCap.Information.ContainerType = TwainContainerType.OneValue
twCap.OneValueCapability.ItemType = TwainItemType.Uint16
twCap.OneValueCapability.Value = TwainCapabilityValue.SupportedSizesA3
_session.SetCapability(twCap, TwainSetCapabilityMode.Set)

(2) For feeder options, you need to set the following capabilities:

' CAP_FEEDERENABLED
twCap.Information.Type = TwainCapabilityType.FeederEnabled
twCap.OneValueCapability.ItemType = TwainItemType.Bool
twCap.OneValueCapability.Value = True
_session.SetCapability(twCap, TwainSetCapabilityMode.Set)

' CAP_AUTOFEED
twCap.Information.Type = TwainCapabilityType.AutoFeed
twCap.OneValueCapability.ItemType = TwainItemType.Bool
twCap.OneValueCapability.Value = True
_session.SetCapability(twCap, TwainSetCapabilityMode.Set)


(2) For Image resolution, you need to set the following capabilities:

' ICAP_XRESOLUTION
twCap.Information.Type = TwainCapabilityType.ImageXResolution
twCap.OneValueCapability.ItemType = TwainItemType.Fix32
twCap.OneValueCapability.Value = 100
_session.SetCapability(twCap, TwainSetCapabilityMode.Set)

' ICAP_YRESOLUTION
twCap.Information.Type = TwainCapabilityType.ImageYResolution
twCap.OneValueCapability.ItemType = TwainItemType.Fix32
twCap.OneValueCapability.Value = 100
_session.SetCapability(twCap, TwainSetCapabilityMode.Set)

(4) What exactly do you mean by "Mode"?

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#9 Posted : Sunday, October 4, 2009 2:45:53 AM(UTC)
christo_1983

Groups: Registered
Posts: 13


I tried the code for setting papersize in the above example as follows,

 twCap.Information.Type = TwainCapabilityType.ImageSupportedSizes
twCap.Information.ContainerType = TwainContainerType.OneValue
twCap.OneValueCapability.ItemType = TwainItemType.Uint16
twCap.OneValueCapability.Value = TwainCapabilityValue.SupportedSizesA3
_session.SetCapability(twCap, TwainSetCapabilityMode.Set)

     An exception was thrown as "Required capability not supported"

kindly provide me solution for this problem.

 
#10 Posted : Sunday, October 4, 2009 4:31:52 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

Does your scanner support the ICAP_SUPPORTEDSIZES capability?

If your scanner doesn't support the ICAP_SUPPORTEDSIZES capability, you will not be able to set the ImageSupportedSizes capability in your code.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
#11 Posted : Saturday, December 5, 2009 3:10:08 AM(UTC)
christo_1983

Groups: Registered
Posts: 13


 

Hi Maen,

    In the above example  i used the image Resolution sample code.

   i got the error as "Invalid Parameter passed" in the below line while execution 

  twCap.OneValueCapability.ItemType = TwainItemType.Fix32

i am using leadtools 16.5 and HP PSC 1410 All - in - One scanner.

Does the value 100 in the below code stands for DPI(dots per inch)

twCap.OneValueCapability.Value = 100

Kindly provide me a solution for the above error.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 
#12 Posted : Sunday, December 6, 2009 1:08:31 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

You need to set the TwainCapability.Information.ContainerType to TwainContainerType.OneValue before setting the capability:
+------------+
TwainCapability twCap = new TwainCapability();
twCap.Information.ContainerType = TwainContainerType.OneValue;
twCap.Information.Type = TwainCapabilityType.ImageXResolution;
twCap.OneValueCapability.ItemType = TwainItemType.Fix32;
twCap.OneValueCapability.Value = 100;
_twainSession.SetCapability(twCap, TwainSetCapabilityMode.Set);
+------------+

For more information about the ICAP_XRESOLUTION capability, please refer to the Twain specification.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.109 seconds.