TWAIN ActiveX Control, Plug-in, Scanner SDK, Component, HTTP Control/SDK

Dynamsoft TWAIN Products

Support Community for TWAIN Control/Component/SDK for Scanning Solutions
* Login   * Register
* FAQ    * Search

It is currently Thu Feb 09, 2012 9:49 am




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Can't scan more than once using an ADF
PostPosted: Sun May 16, 2010 11:24 am 
Offline

Joined: Sun May 16, 2010 6:29 am
Posts: 5
The following code can be called and called when not using an adf, you can call it with adf off and then once with adf, and then no other scan will work, bascally 1 adf scan kills the scanner (restarting the app is necessary), Visual Studio cannot debug it as it's in "native code" am I doing something really dumb or is there a problem?

- Anthony



DNTwain.IfThrowException = false;
DNTwain.OpenSourceManager();
DNTwain.IfShowUI = false;
DNTwain.OpenSource();
DNTwain.IfDisableSourceAfterAcquire = true;
DNTwain.MaxImagesInBuffer = 100;
switch (ResolutionDropDown.Text)
{
case "150 dpi":
DNTwain.Resolution = 150;
break;
case "300 dpi":
DNTwain.Resolution = 300;
break;
case "600 dpi":
DNTwain.Resolution = 600;
break;
case "1200 dpi":
DNTwain.Resolution = 1200;
break;
default:
DNTwain.Resolution = 150;
break;
}

switch (DepthDropdown.Text)
{
case "Monochrome":
DNTwain.PixelType = Dynamsoft.DotNet.TWAIN.Enums.TWICapPixelType.TWPT_BW;
DNTwain.BitDepth = 1;
break;
case "Grayscale":
DNTwain.PixelType = Dynamsoft.DotNet.TWAIN.Enums.TWICapPixelType.TWPT_GRAY;
DNTwain.BitDepth = 8;
break;
case "Full Colour (16-bit)":
DNTwain.PixelType = Dynamsoft.DotNet.TWAIN.Enums.TWICapPixelType.TWPT_RGB;
DNTwain.BitDepth = 16;
break;
case "Full Colour (24-bit)":
DNTwain.PixelType = Dynamsoft.DotNet.TWAIN.Enums.TWICapPixelType.TWPT_RGB;
DNTwain.BitDepth = 24;
break;
}

if (ADFCheckbox.IsChecked == true)
{
DNTwain.IfFeederEnabled = true;

}
else
{
DNTwain.IfFeederEnabled = false;
}

DNTwain.AcquireImage();
DNTwain.DisableSource();
DNTwain.CloseSource();
DNTwain.CloseSourceManager();


Top
 Profile  
 
 Post subject: Re: Can't scan more than once using an ADF
PostPosted: Mon May 17, 2010 12:46 am 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1067
Hi Anthony,

Please comment out the following lines and try scanning with ADF again to see how it works.
Code:
//DNTwain.DisableSource();
//DNTwain.CloseSource();
//DNTwain.CloseSourceManager();

Also, you can call CloseSource in OnPostAllTransfers event, which will be triggered after all transfers end. For more information about this event, please refer to:
http://www.dynamsoft.com/help/TWAIN/.Ne ... nsfers.htm

Thanks.

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
 Post subject: Re: Can't scan more than once using an ADF
PostPosted: Mon May 17, 2010 2:10 am 
Offline

Joined: Sun May 16, 2010 6:29 am
Posts: 5
Hello, those lines weren't there until I tried to fix the issue, I'll try the closing the source in the event and see if that helps.

The strange thing is it's sitting on the set resolution line, like the scanner is in a state that won't accept parameters, which is why I tried adding those lines at the end.

- Anthony

Catherine wrote:
Hi Anthony,

Please comment out the following lines and try scanning with ADF again to see how it works.
Code:
//DNTwain.DisableSource();
//DNTwain.CloseSource();
//DNTwain.CloseSourceManager();

Also, you can call CloseSource in OnPostAllTransfers event, which will be triggered after all transfers end. For more information about this event, please refer to:
http://www.dynamsoft.com/help/TWAIN/.Ne ... nsfers.htm

Thanks.


Top
 Profile  
 
 Post subject: Re: Can't scan more than once using an ADF
PostPosted: Thu May 20, 2010 3:06 am 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 1067
Hi Anthony,

You can contact our support team via LiveHelp to have a GoToMeeting session. With GoToMeeting, you can share your desktop and give us controls of your mouse and keyboard when necessary. Our LiveHelp can be found at:
http://www.dynamsoft.com/support/livehelp.aspx

Thanks.

_________________
Catherine Sea
TWAIN Support Team
TWAIN ActiveX/Plug-in for Web Applications, Scanner COM Control
TWAIN .NET Component/SDK for Desktop Applications

Follow me @Twitter, Facebook
Image


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

It is currently Thu Feb 09, 2012 9:49 am


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:
Jump to:  
cron

Copyright © 2010 Dynamsoft Corporation. All Rights Reserved. | Knowledge Base | Source Control Blog