VintaSoft Twain .NET SDK Discussions

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

Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

How to detect paper not inserted properly?



How to detect paper not inserted properly?

Post by BillG »

How do I detect if the paper is not properly inserted into the scanner, ie hitting the paper indicator clip?


Re: How to detect paper not inserted properly?

Post by Alex »

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:
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


Page 1 from 1: 1