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.