title: Trouble with transfer function in WIA C#
body: <p>I have a problem with the below code. I want to scan a document by clicking a button in a WinForms C# application.</p>
  
  <p>I use WIA, Visual studio and the scanner Fujitsu N7100A working with Windows 8. I am following a tutorial online for using WIA. </p>
  
  <p>But the program doesn't run as expected. It seems to break down at the Transfer method.</p>
  
  <pre><code>            // Create a DeviceManager instance 
              var deviceManager = new DeviceManager();
              // Create an empty variable to store the scanner instance
              DeviceInfo firstScannerAvailable = null;
              // Loop through the list of devices to choose the first available 
              AddLogs(deviceManager.DeviceInfos.Count.ToString(), filename);
              foreach (DeviceInfo d in deviceManager.DeviceInfos)
              {
                  if (d.Type == WiaDeviceType.ScannerDeviceType)
                  {
                      firstScannerAvailable = d;
                  }
              }
              // Connect to the first available scanner 
              var device = firstScannerAvailable.Connect();
              // Select the scanner 
              var scannerItem = device.Items[0];
              // Retrieve a image in JPEG format and store it into a variable 
              var imageFile = (ImageFile)scannerItem.Transfer(FormatID.wiaFormatPNG);
              //Save the image in some path with filename 
              var path = @"C:\Documents\scan.png";
              if (File.Exists(path))
              {
                  File.Delete(path);
              }
              // Save image ! 
              imageFile.SaveFile(path);
  </code></pre>
  
  <p>I just have to remove the addition of lines in the file of log.</p>