Create 2 multipage tiffs from scanned images
Create 2 multipage tiffs from scanned images
I need a way to make 2 sets of files from my scanned images. I need 1 set with blank pages and one set without. I can't figure out how to do this, is there a way to make 2 multipage tiff files with these images?
Re: Create 2 multipage tiffs from scanned images
HI,
There is a lot a ways to do that using the Imaging class.
I give you one of them consisting to use 2 Imaging Objects. One for the main multipage tiff file, and one other for the multipage which contains the detected blank pages.
There is a lot a ways to do that using the Imaging class.
I give you one of them consisting to use 2 Imaging Objects. One for the main multipage tiff file, and one other for the multipage which contains the detected blank pages.
Code: Select all
Dim Imaging1 As New GdPicturePro5.cImaging
Dim Imaging2 As New GdPicturePro5.cImaging
Dim nImageCount As Long
Dim nBlankImageCount As Long
Dim nImageID As Long
Call Imaging1.TwainOpenDefaultSource
nImageCount = 0
Imaging1.TwainSetAutoFeed (True)
Imaging1.TwainSetAutoScan (True)
While Imaging1.CreateImageFromTwain(Me.hWnd) <> 0
nImageID = Imaging1.GetNativeImage
If Imaging1.IsBlank(99) Then
nImageCount = nImageCount + 1
If nImageCount = 1 Then
Call Imaging1.TiffSaveAsNativeMultiPage(App.Path & "\multipage.tif", CompressionCCITT4)
Else
Imaging1.TiffAddToNativeMultiPage (nImageID)
Imaging1.CloseImage (nImageID)
End If
Else
nBlankImageCount = nBlankImageCount + 1
If nBlankImageCount = 1 Then
Imaging2.SetNativeImage (nImageID)
Call Imaging2.TiffSaveAsNativeMultiPage(App.Path & "\multipageblank.tif", CompressionCCITT4)
Else
Imaging2.TiffAddToNativeMultiPage (nImageID)
Imaging1.CloseImage (nImageID)
End If
End If
Wend
Imaging1.TiffCloseNativeMultiPage
Imaging2.TiffCloseNativeMultiPage
Imaging1.TwainCloseSource
MsgBox "Done !"
Who is online
Users browsing this forum: No registered users and 2 guests