I tried to read some previous cases regarding this but I have not been able to get useful information.
I am trying to scan multiple documents but when the scanner finish only the last page is saved.
Somehow my code looks like this.
While TwainSource.AcquireModal()
Debug.Print("Scanned an image")
GetImage(TwainSource)
End While
Private Sub GetImage(ByVal TwainSource As VSTwain)
Dim noiseLevel As Single
If TwainSource.IsBlankImage(0, 1.0, noiseLevel) Then
Debug.Print("Blank page detected")
' Me.Jobs.Add(Me.CurrentJob)
RaiseEvent JobComplete(Me.CurrentJob)
Me.CurrentJob = New Scanjob(LoggedInUser)
Else
Dim img As New Bitmap(TwainSource.GetImage(0))
Dim sc As ScannedImage = Me.CurrentJob.AddImage(img, Date.Now.Ticks.ToString & ".tiff")
RaiseEvent NewDocumentScanned(sc)
End If
Debug.Print("Noise level: " & noiseLevel.ToString())
End Sub
Any help is appreciated on this case.Alejandro
