Setting Scanner dpi with TWAINDotNet: setting dpi >1200 fails

1.6k views Asked by At

I am trying to use the TWAINDotNet API to control an Epson Scanner. I have almost everything working, but I can't set the dpi properly.

If I set the API at 300, 600 or even 1199 dpi, the scanner works as expected. Unfortunately when I try to set the dpi to 1200 or above, I get a TWAINException indicating "TwainDotNet.TwainNative.ConditionCode.CapabilitySequenceError". The scanner is certainly capable of 1200pi (as well as even high dpi values).

I am using TWAINDotNet from VB.Net 2010

I appreciate any comments.

2

There are 2 answers

1
hometoast On

Twain's "CapabilitySequenceError" means, "Capability has dependency on other capability". It will depend on your specific scanner what else you need to set before setting the dpi to 1200.

In some cases, the scanner expects caps to be set in a particular order. Off the top of my head, perhaps you need to change the scanning speed to 'slow' (I'm just guessing).

0
Ian Journeaux On

Working with Epson, I was able to solve the problem. On the V550 scanner, the maximum resolution is a fuction of the area to be scanned. For a full 8.5inx11in page, the maximum resolution is 1184dpi.

To set resolutions higher than 1200dpi, you need to set the area to be scanned to a smaller region.

To correct the issue, in datasource.cs, all you have to do is move the

if (settings.Area != null)
{
    NegotiateArea(settings);
}

before

if (settings.Resolution != null)
{
    NegotiateColour(settings);
    NegotiateResolution(settings);
}