I am playing with the code from http://www.codeproject.com/KB/dotnet/twaindotnet.aspx
I am having a problem because twain returns control only after all documents in feeder are scanned. This leads to high memory usage if I scan 20 or more documents.
I thought of scanning just one document at a time from the feeder and saving the image and calling the api again in a loop.
I am setting cap_xfercount to 1 but this does not seem to help:
TwCapability cap = new TwCapability(TwCap.XferCount, 1);
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, cap);
What do I need to do to scan just one document from the feeder? Any suggestions appreciated.