How to detect paper not inserted properly?

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
BillG
Posts: 47
Joined: Fri Oct 10, 2008 3:52 pm

How to detect paper not inserted properly?

Post by BillG » 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?

Alex
Site Admin
Posts: 1461
Joined: Thu Jul 10, 2008 2:21 pm

Re: How to detect paper not inserted properly?

Post by Alex » Wed May 06, 2009 8:15 am

Hello Bill,

Please read the "Error Trapping" topic in the "Getting Started" section of documentation.

Here is an example that demonstrates how to intercept paper jam or double feeding of paper:

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
Best regards, Alexander

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest