我正在编写一个程序,通过WIA与网络扫描仪一起工作。 当只扫描一页时,一切正常。当我打开进纸器:WIA +网络扫描仪,adf = 1页
foreach (WIA.Property deviceProperty in wia.Properties)
{
if (deviceProperty.Name == "Document Handling Select")
{
int value = duplex ? 0x004 : 0x001;
deviceProperty.set_Value(value);
}
}
程序接收扫描,仍有在馈线文档和COM错误脱落(扫描仪继续扫描)信号。 下面的代码检查页进纸器:
//determine if there are any more pages waiting
Property documentHandlingSelect = null;
Property documentHandlingStatus = null;
foreach (Property prop in wia.Properties)
{
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_SELECT)
documentHandlingSelect = prop;
if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT_HANDLING_STATUS)
documentHandlingStatus = prop;
}
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & 0x00000001) != 0)
{
return ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & 0x00000001) != 0);
}
return false;
获取图片代码:
imgFile = (ImageFile)WiaCommonDialog.ShowTransfer(item, wiaFormatJPEG, false);
可惜找不到使用WIA WSD的例子。也许有一些设置可以通过WSD获取多个图像。
我也有[相同的问题](http://stackoverflow.com/questions/27473142/cannot-read-second-page-scanned-via-adf/31908751#31908751),我通过安装制造商的驱动程序解决。 – 2015-08-09 21:07:21