This project has moved. For the latest updates, please go here.

Feeder doesn't work

Nov 15, 2016 at 2:35 PM
Hello!

I'm trying get feeder (ADF) images with serveral pages.

If I don't especify any setting o capabilitie, it only gets one page. If I try put the feeder capabilitie, the methode Acquire does nothing.

The code is:
            this._twain.OpenDataSource();

            this._twain.SetCap(TwCap.AutoFeed, true);
            this._twain.SetCap(TwCap.FeederEnabled, true); 

            this._twain.Acquire();

Hope you can help me!

Regards,
Hector.
Coordinator
Nov 15, 2016 at 3:42 PM
Hello, hgramaje.
Try follow code.
        if(this._twain32.Capabilities.FeederEnabled.IsSupported(TwQC.Set)) {
            this._twain32.Capabilities.FeederEnabled.Set(true);

            if(this._twain32.Capabilities.AutoFeed.IsSupported(TwQC.Set)) {
                this._twain32.Capabilities.XferCount.Set(true);
            }
 
            if(this._twain32.Capabilities.XferCount.IsSupported(TwQC.Set)) {
                this._twain32.Capabilities.XferCount.Set(-1);
            }
        }
Marked as answer by SARAFF on 11/25/2016 at 11:12 AM
Nov 18, 2016 at 6:32 AM
Hi Saraff!!
I discovered my problem was on drivers scanner.

Now I have other important problem:

When I scan with high resolution (600 ppp), the method "Twain32.GetImage(index)" returns Out Of Memory exception. Has it solution? Or I can't process images so long? I've seen in other SDK's (with payment) that is processing good.

Thank you very much.

Regards,
Hector.
Coordinator
Nov 18, 2016 at 12:11 PM
Edited Nov 18, 2016 at 2:13 PM
Hello, hgramaje.
Try follow code:
/// <summary>
/// Occurs at the end of every transfer when the application has received all the data it expected.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void _twain32_EndXfer(object sender,Twain32.EndXferEventArgs e) {
    try {
        using(var _image = e.Image) {
            _image.Save("filename.tif",ImageFormat.Tiff);
        }
    } catch(Exception ex) {
        // ...
    }
}
Also, you can try use other transfer modes. See Options for Transferring Data
Nov 21, 2016 at 9:48 AM
Not working.

The process throws one exception:

e.Image = 'e.Image' threw an exception of type 'System.OutOfMemoryException'

And if I repeat the execution of the image that give problems, like a while, finally it works. What's the cause of this OutMemoryException?

Thanks,
Hector.
Coordinator
Nov 21, 2016 at 2:54 PM
Hello, hgramaje.
Try this a sample to scan. After scanning it create file on a desktop. If you give exception, send to me this file.