This project has moved and is read-only. For the latest updates, please go here.

Scann front and back

Aug 14, 2014 at 9:17 PM
Hi!

I'm using a HP 3000 s2 scanner, that supports "front and back". If I let ShowUI true, I can chose this option and the Acquire returns 2 images. But I need to scann it automatically, without show UI.

What property should I set to define it?

Thanks in advance.
Aug 14, 2014 at 10:23 PM
Hello, joelrlneto!
See documentation
Aug 14, 2014 at 10:28 PM
Hi, Saraff. Thanks for your reply.

I'd read the documentation, but I don't know wich capability I should set up. I've tried to set the Duplex and DuplexEnabled capabilities to true, but I get the message Источник данных не открыт.

Thank you!
Aug 15, 2014 at 5:53 AM
Hello, joelrlneto!
To work with the capabilities, you must open data source (Twain32.OpenDataSource()). See TWAIN 2.3 Specification
Aug 15, 2014 at 1:51 PM
Yes, I did it. But I still get this message, even calling OpenDataSource before SetCap. I did it by this way:
try
{
    twain.OpenDataSource();
    twain.SetCap(TwCap.Duplex, true);
    twain.Acquire();
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message, "SAMPLE1", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
If I set twain.SetDefaultSource(0), before twain.OpenDataSource(), then I get the message DSM не открыт.
I downloaded DSM, but it is a DLL and I don't know what to do with it.


Thanks.
Aug 15, 2014 at 4:29 PM
Hello, joelrlneto!
Try follow actions:
  1. invoke Twain32.OpenDSM();
  2. set value of Twain32.SourceIndex (if need select DS);
  3. invoke Twain32.OpenDataSource();
  4. work with capabilities.
See Saraff.Twain.Sample2 and TWAIN 2.3 Specification
Marked as answer by joelrlneto on 8/15/2014 at 12:35 PM
Aug 15, 2014 at 8:35 PM
Thank you, Saraff. I did it and now my project works perfectly.
Thank you for the great job.