0

I got the following code for duplex scanning which uses WIA2 for communication with scanners. It works perfectly with Fujitsu fi-6130 but there is an issue with Epson GT-S55. The problem is, it saves the second image of the duplex scan blank (in black color). Is there a property that I'm missing here?.

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    ADFScan()
End Sub

Public Sub ADFScan()
    Dim WiaDialog1 As New WIA.CommonDialog
    Dim WiaDevice1 As WIA.Device = WiaDialog1.ShowSelectDevice(WIA.WiaDeviceType.ScannerDeviceType, False, False)

    WiaDevice1.Properties("3088").let_Value("4")    'WIA_DPS_DOCUMENT_HANDLING_SELECT = 3088, DUPLEX = 4

    Dim Image1 As WIA.ImageFile = DirectCast(WiaDevice1.Items(1).Transfer(WIA.FormatID.wiaFormatBMP), WIA.ImageFile)     'Paper side A
    Dim Image2 As WIA.ImageFile = DirectCast(WiaDevice1.Items(1).Transfer(WIA.FormatID.wiaFormatBMP), WIA.ImageFile)     'Paper side B

    Image1.SaveFile("C:\SideA.bmp")
    Image2.SaveFile("C:\SideB.bmp")
End Sub

I tried setting the WIA_DPS_PAGES property to 1 as suggested in C# WIA with Automatic Document Feeder (ADF) retuns only one page on certain scanners but it didn't worked.

These are some of the properties set by default for the Epson scanner.

Property name                     ID    Value
--------------------------------------------------------------
Document Handling Capabilities    3086     33
Document Handling Select          3088      1
Document Handling Capacity        3089    100
Pages                             3096      0

Thanks in advance.

Community
  • 1
  • 1
David -
  • 2,009
  • 1
  • 13
  • 9
  • After a lot of research and testing, i realized that WIA2 has a completely different behavior with different scanners irrelevant of the properties that you may set. So, in order to use the feeder and duplex property of my scanners, I finally decided to try TWAIN. I found a great open source project called TwainDotNet https://github.com/tmyroadctfig/twaindotnet which is based on another great project the openTWAIN http://opentwain.codeplex.com/. It contains all the dlls for the communication and sample code for VB.NET and C#. – David - Jun 09 '13 at 13:00
  • You should try **WIA_DPS_DOCUMENT_HANDLING_SELECT** as found here https://learn.microsoft.com/en-us/windows-hardware/drivers/image/wia-dps-document-handling-select – Marcelo Gazzola Jun 08 '20 at 21:59

0 Answers0