How to detect paper not inserted properly?
Posted: Wed May 06, 2009 12:27 am
How do I detect if the paper is not properly inserted into the scanner, ie hitting the paper indicator clip?
Here you can ask questions and get answers about VintaSoft products.
http://www.vintasoft.com/forums/
Code: Select all
Public Sub ScanWithUI()
' set the application name
VSTwain1.AppProductName = "MyTwainApplication"
Try
' initialize the library
VSTwain1.StartDevice
' show "Select Source" dialog
VSTwain1.SelectSource
' enable the user interface (false - disable the user interface)
VSTwain1.ShowUI = true
' start asynchronous acquisition process
VSTwain1.Acquire
Catch ex As TwainException
MsgBox ex.Message
End Try
End Sub
...
Private Sub VSTwain1_ScanCompleted(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles VSTwain1.ScanCompleted
' show error message if error occur
If VSTwain1.ErrorCode <> ErrorCode.None Then
If VSTwain1.ErrorCode = ErrorCode.FeederProblem Then
MsgBox("Paper is jammed or double feeded.")
End If
' show message "Scan process is completed."
Else
MsgBox("Scan process is completed.")
End If
End Sub