Contact us


All times are UTC - 8 hours



   [ 6 posts ] 
Author Message
   


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


User avatar
   


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1706
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.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


   


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


User avatar
   


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1706
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.

In Dynamic Web TWAIN 5.* or earlier versions, 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.

In Dynamic Web TWAIN 6.0, both trial and full versions of Dynamic Web TWAIN can hold 1024 images in buffer.

In Dynamic Web TWAIN 6.1, both trial and full versions of Dynamic Web TWAIN can hold 4096 images in buffer.

Thanks.

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


   


Joined: Wed Nov 08, 2017 3:56 am
Posts: 2
Hello,


Can you please give me any suggestion for increasing Multi-page scanning performance?

Scanning microfilm


User avatar
   


Joined: Tue Mar 08, 2005 12:23 am
Posts: 1706
Hi Nandy1234,

May I know more details about the multi-page scanning performance you are referring to?

Hope to hear from you soon.

Regards,

_________________
Vincy
Dynamsoft Support Team
Follow us@Twitter, Facebook


Display posts from previous:  Sort by  
   [ 6 posts ] 


Who is online

Users browsing this forum: No registered users and 1 guest


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 © 2018 Dynamsoft | All Rights Reserved
dynamic designed by Dynamsoft team
Fatal: Not able to open ./cache/data_global.php