I am trying to scan a few pages from the feeder, although the scanner automatically scans all the pages when I call ShowTransfer function (without using a loop), I am getting back only the first page.
what am I doing wrong?
here's my code:
WIA.Item item = device.Items[1] as WIA.Item;
if (pages > 1)
{
// Set to feeder
SetWIAProperty(device.Properties, 44, 1);
}
SetWIAProperty(device.Properties, WIA_DEVICE_PROPERTY_PAGES_ID, 1);
AdjustScannerSettings(item, 150, 0, 0, 1250, 1700, 0, 0, 1);
try
{
// scan image
WIA.ICommonDialog wiaCommonDialog = new WIA.CommonDialog();
WIA.ImageFile image = (WIA.ImageFile)wiaCommonDialog.ShowTransfer(item, wiaFormatBMP, false);
// save to temp file
string fileName = Path.GetTempFileName();
File.Delete(fileName);
image.SaveFile(fileName);
image = null;
// add file to output list
images.Add(Image.FromFile(fileName));
}
catch (Exception exc)
{
throw exc;
}