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 Tue Sep 07, 2010 4:21 pm




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Duplex Scanning not Working Correctly
PostPosted: Tue Mar 02, 2010 2:41 pm 
Offline

Joined: Tue Mar 02, 2010 2:23 pm
Posts: 3
Hi,

I'm trying to set up a test scan application to test the API features of the ActiveX control. When duplex is off, the application correctly scans the document. However, when I turn duplex scanning on, it only scans the back of the image. It does not correctly place two pages in the buffer. Here's the JavaScript code I'm using to scan the image:

function btnScan_onclick()
{
var dwt = document.getElementById("DynamicWebTwain1");
var srcDD = document.getElementById("scanSource");
var duplexCB = document.getElementById("duplexEnabled");

//setup the scan properties
dwt.CloseSource();
dwt.SelectSourceByIndex(srcDD.selectedIndex.value)
dwt.OpenSource();

//setup duplex scanning if supported by the scanner
alert("duplex: " + dwt.Duplex);
if( dwt.Duplex > 0 )
{
dwt.IfDuplexEnabled = duplexCB.checked;
}

alert("is duplex enabled?: " + dwt.IfDuplexEnabled);

//start the scan
dwt.AcquireImage();
}

The first alert writes out "Duplex: 1" and the second one shows IfDuplexEnabled to be true.

Am I missing something that makes the control execute a duplex scan? The odd thing is that when the TWAIN Driver (32) control pops up, it already has ADF (Duplex) set in the scan type dropdown.

Thanks!

George


Top
 Profile  
 
 Post subject: Re: Duplex Scanning not Working Correctly
PostPosted: Tue Mar 02, 2010 8:49 pm 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 839
Hi George,

To get multiple images into the control, you need to set the value of MaxImagesInBuffer to the image number you want to scan (the default value of MaxImagesInBuffer is 1). For more info, please refer to:
http://www.dynamsoft.com/help/TWAIN/Web ... Buffer.htm

Here is the modified code for you:

Code:
dwt.SelectSourceByIndex(srcDD.selectedIndex.value)
dwt.OpenSource();

dwt.MaxImagesInBuffer = 4;
...
dwt.AcquireImage();


Quote:
The odd thing is that when the TWAIN Driver (32) control pops up, it already has ADF (Duplex) set in the scan type dropdown.

The default settings are decided by the driver of your scanner. You can set the value of IfShowUI to false to disable the user interface of the source, so you can control Duplex by the checkbox as you designed.

Thanks.

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


Top
 Profile  
 
 Post subject: Re: Duplex Scanning not Working Correctly
PostPosted: Wed Mar 03, 2010 8:33 am 
Offline

Joined: Tue Mar 02, 2010 2:23 pm
Posts: 3
That worked great, thanks! I'm guessing the MaxImagesInBuffer property is used to control the memory usage on the client...

One question though - what if you don't know the number of pages that a user is going to scan? Is there a way to dynamically set that property, or do you just have to set it to a sufficiently large number to try to accommodate the majority of documents?

Thanks,

George


Top
 Profile  
 
 Post subject: Re: Duplex Scanning not Working Correctly
PostPosted: Wed Mar 03, 2010 9:29 am 
Offline
User avatar

Joined: Tue Mar 08, 2005 12:23 am
Posts: 839
Hi George,

Thanks for the update. I’m glad to hear that it works.

The MaxImagesInBuffer property is used to set the maximum number of images that can be held in buffer. You can set it to a sufficiently large number according to your needs.

The trial version of Dynamic Web TWAIN can hold 4 images in buffer at most and the full version can hold up to 1024 images.

Thanks.

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


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

It is currently Tue Sep 07, 2010 4:21 pm


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

Version Control Software/System | Source Control Software/System | Software Configuration Management | SCM Hosting | Bug Tracking System | Scanner COM
SourceSafe (VSS) Replacement/Alternative | SourceSafe (VSS) Hosting | SourceSafe (VSS) Remote/Web/Internet Access | SourceSafe (VSS) Tutorial
Copyright © 2010 Dynamsoft Corporation. All Rights Reserved. | Knowledge Base | Source Control Blog