I am developing a C # application to use the WIA 2.0 library. At the moment, I can use most functions, such as ADF (automatic document feeder), filters, etc.
Now I need to use the duplexer of my scanner (fujitsu).
I am trying to set the scanner's WIA_DPS_DOCUMENT_HANDLING_SELECT property to DUPLEX. See code below:
try
{
bool hasMorePages = false;
Property documentHandlingSelect = null;
Property documentHandlingStatus = null;
foreach (Property prop in WiaDev.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;
}
object obj = new object();
obj = (WIA_DPS_DOCUMENT_HANDLING_SELECT.DUPLEX);
documentHandlingSelect.set_Value(ref obj);
if (documentHandlingSelect != null)
{
if ((Convert.ToUInt32(documentHandlingSelect.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER) != 0)
{
hasMorePages = ((Convert.ToUInt32(documentHandlingStatus.get_Value()) & WIA_DPS_DOCUMENT_HANDLING_STATUS.FEED_READY) != 0);
if (hasMorePages)
{
object obj = new object();
obj = (WIA_DPS_DOCUMENT_HANDLING_SELECT.FEEDER | WIA_DPS_DOCUMENT_HANDLING_SELECT.DUPLEX);
documentHandlingSelect.set_Value(ref obj);
}
}
}
return hasMorePages;
This code compiles fine, but I cannot get two images while executing this line. It only extracts the front:
imgFile = (ImageFile)wiaCommonDialog.ShowTransfer(item, format.Guid.ToString("B")/* wiaFormatJPEG*/, false);
I read in many topics, as well as in the documentation, that you can get Children objects from an element on a scanner, but there is only one element in this collection.
Please help me!
thank