开发者

WIA via silverlight, duplex scanning

I'm trying to scan an A3 page in duplex using my Xerox documate 752. I'm getting it to scan fine using the document feeder but only on side. How do I access the other image??

Here is my basic code:

dynamic imageFile1;
dynamic imageFile2;
dynamic wiaDialog = AutomationFactory.CreateObject("WIA.CommonDialog");
dynamic Scanner = wiaDialog.ShowSelectDevice(1, false, false);
dynamic manager = AutomationFactory.CreateObject("WIA.DeviceManager");
dynamic deviceInfo = null;
foreach (dynamic info in manager.DeviceInfos)
                        {
                            if (info.DeviceID == Scanner.DeviceID)
                            {
                                deviceInfo = info;
                            }
                        }
          dynamic device = deviceInfo.Connect();

        dynamic item = device.Items[1];
        int dpi = 150;
                   item.Properties["6146"].Value = 2;
            item.Properties["6147"].Value = dpi;
            item.Properties["6148"].Value = dpi;
            item.Properties["6151"].Value = (int)(dpi * _width);
            item.Properties["6152"].Value = (int)(dpi * _height);

     int deviceHandling = 5;//code for both feed (1) + duplex (4) 

                        device.Properties["3088"].Value =  deviceHandling;


                        int handlingStatus = (int)device.Properties["3087"].Value;

                       if (handlingStatus == deviceHandling)
                        {                     
    //sc开发者_C百科an the file
                            imageFile1 = wiaDialog.ShowTransfer(item, "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}", true);

//get the second image
  imageFile2 = wiaDialog.ShowTransfer(item, "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}", true);
    }

     imageFile1.SaveFile("C:\\testfile1.jpg");
 imageFile2.SaveFile("C:\\testfile1_2.jpg");

From what I've read elsewhere if there is a duplex image you access it by calling the ShowTransfer() again. On my scanner this simple tries to scan a new document and returns an error as the feeder is now empty. I'm getting a 5 returned from my handlingStatus indicating that both feed (1) and duplex (4) are turned on - or have i got this totally wrong?

Any help would be much appreciated.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜