How to scan multiformat multipage document at once time
How to scan multiformat multipage document at once time
How to scan multipage document then save the result as multipage PDF and multipage TIFF at once time
Thank you
Thank you
Re: How to scan multiformat multipage document at once time
Hi,
A vb sample using GdPicture Pro ActiveX:
A vb sample using GdPicture Pro ActiveX:
Code: Select all
Dim nImageID As Long
Dim nImageCount As Long
Imaging1.TwainSelectSource
If Imaging1.TwainOpenDefaultSource() Then
Imaging1.TwainSetAutoFeed (True) 'Set AutoFeed Enabled
Imaging1.TwainSetAutoScan (True) 'To achieve the maximum scanning rate
Imaging1.TwainSetCurrentResolution (300)
Imaging1.TwainSetCurrentPixelType (TWPT_RGB) 'RGB
Imaging1.TwainSetCurrentBitDepth (8) ' 24 bpp
Imaging1.TwainPdfStart ("output.pdf")
nImageCount = 0
While Imaging1.CreateImageFromTwain(Me.hWnd) <> 0
nImageCount = nImageCount + 1
nImageID = Imaging1.GetNativeImage
'Saves to native pdf
Call Imaging1.TwainAddGdPictureImageToPdf(nImageID)
'Saves to native multipage tiff image
If nImageCount = 1 Then
Call Imaging1.TiffSaveAsNativeMultiPage("output.tif", CompressionLZW)
Else
Call Imaging1.TiffAddToNativeMultiPage(nImageID)
Imaging1.CloseImage (nImageID)
End If
Wend
Imaging1.TwainPdfStop
Imaging1.TiffCloseNativeMultiPage
Call Imaging1.TwainCloseSource
MsgBox "Done !"
Else
MsgBox "can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState))
End If
Re: How to scan multiformat multipage document at once time
hi Loic,
how to combine it with blank page discard function in this routine
i have try the discard blank page sample but always fail
may you can help me fix this
thank a lot
how to combine it with blank page discard function in this routine
i have try the discard blank page sample but always fail
may you can help me fix this
thank a lot
Re: How to scan multiformat multipage document at once time
hi loic,
i am sorry but i think your sample code is not working
i has use the code as same as your sample
i also modify the sample code
the code can't scan multipage multi format documents properly
it's also can't discard the blank page so can you help me to fix it
the code also often hung or stoped and i have to close it
this is the code that i use
the result of tif file only contain the first page from multipage
the pdf result contain the whole blank pages
for the blank pages - how to discard them
and for the compression i prefer to use jpeg for all format - is it avaiable or not
how to use the jpeg compression for all format
which code part that incorrect
which code part that i have to change or modify
please reply as soon as possible i am really need it
thank you very much [/color]
i am sorry but i think your sample code is not working
i has use the code as same as your sample
i also modify the sample code
the code can't scan multipage multi format documents properly
it's also can't discard the blank page so can you help me to fix it
the code also often hung or stoped and i have to close it
this is the code that i use
Code: Select all
Dim nImageID As Long
Dim nImageCount As Long
If Imaging1.TwainOpenDefaultSource() Then
Imaging1.TwainSetAutoFeed (True) 'Set AutoFeed Enabled
Imaging1.TwainSetAutoScan (True) 'To achieve the maximum scanning rate
Imaging1.TwainSetHideUI (True) 'To hide the twain user interface
Imaging1.TwainSetCurrentResolution (200)
Imaging1.TwainSetCurrentPixelType (TWPT_RGB) 'RGB
Imaging1.TwainSetCurrentBitDepth (8) ' 24 bpp
Imaging1.TwainPdfStart ("c:\output.pdf") 'pdf output
nImageCount = 0
While Imaging1.CreateImageFromTwain(Me.hWnd) <> 0
nImageCount = nImageCount + 1
nImageID = Imaging1.GetNativeImage
if Imaging1.IsBlank(98) = True Then
Call Imaging1.CloseImage(nImageID)
Else
'Saves to native multipage tiff image
If nImageCount = 1 Then
Call Imaging1.TiffSaveAsNativeMultiPage("c:\output.tif", CompressionLZW) 'tif output
Else
Call Imaging1.TiffAddToNativeMultiPage(nImageID)
End If
'Saves to native pdf
Call Imaging1.TwainAddGdPictureImageToPdf(nImageID)
Imaging1.CloseImage (nImageID)
End If
Wend
Imaging1.TwainPdfStop
Imaging1.TiffCloseNativeMultiPage
Call Imaging1.TwainCloseSource
Else
MsgBox "can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState))
End If
the pdf result contain the whole blank pages
for the blank pages - how to discard them
and for the compression i prefer to use jpeg for all format - is it avaiable or not
how to use the jpeg compression for all format
which code part that incorrect
which code part that i have to change or modify
please reply as soon as possible i am really need it
thank you very much [/color]
Re: How to scan multiformat multipage document at once time
Hi,
I've updated the code above.
Now, I give you another version to discard blank pages:
Best regards,
Loïc
I've updated the code above.
Now, I give you another version to discard blank pages:
Code: Select all
Dim nImageID As Long
Dim nImageCount As Long
Imaging1.TwainSelectSource
If Imaging1.TwainOpenDefaultSource() Then
Imaging1.TwainSetAutoFeed (True) 'Set AutoFeed Enabled
Imaging1.TwainSetAutoScan (True) 'To achieve the maximum scanning rate
Imaging1.TwainSetCurrentResolution (300)
Imaging1.TwainSetCurrentPixelType (TWPT_RGB) 'RGB
Imaging1.TwainSetCurrentBitDepth (8) ' 24 bpp
Imaging1.TwainPdfStart ("c:\output.pdf")
nImageCount = 0
While Imaging1.CreateImageFromTwain(Me.hWnd) <> 0
If Not Imaging1.IsBlank(98) Then
nImageCount = nImageCount + 1
nImageID = Imaging1.GetNativeImage
'Saves to native pdf
Call Imaging1.TwainAddGdPictureImageToPdf(nImageID)
'Saves to native multipage tiff image
If nImageCount = 1 Then
Call Imaging1.TiffSaveAsNativeMultiPage("c:\output.tif", CompressionLZW)
Else
Call Imaging1.TiffAddToNativeMultiPage(nImageID)
Imaging1.CloseImage (nImageID)
End If
End If
Wend
Imaging1.TwainPdfStop
Imaging1.TiffCloseNativeMultiPage
Call Imaging1.TwainCloseSource
MsgBox "Done !"
Else
MsgBox "can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState))
End If
Best regards,
Loïc
Re: How to scan multiformat multipage document at once time
hello Loic,
the example is working fine to handle multipage documents otherwise
i am sorry that your new example not working to handle the blank pages
there are still blank pages included in the scan results
it might cause by the IsBlank method that fail to handle the blank pages
is there need some modification to make the code work proper
i am really have no idea why this still exist i am use your code in vb6 sp6 and with fujitsu fi-5120c
i am also found that the file size too big maybe this couse by the file compression
i am try to make the result with low file size without compromising the quality
maybe i am need the better compression method to handle this
could you provide the example for other file compression method maybe jpeg
thank you very much for the helps and attentions
regards,
david sugandi
the example is working fine to handle multipage documents otherwise
i am sorry that your new example not working to handle the blank pages
there are still blank pages included in the scan results
it might cause by the IsBlank method that fail to handle the blank pages
is there need some modification to make the code work proper
i am really have no idea why this still exist i am use your code in vb6 sp6 and with fujitsu fi-5120c
i am also found that the file size too big maybe this couse by the file compression
i am try to make the result with low file size without compromising the quality
maybe i am need the better compression method to handle this
could you provide the example for other file compression method maybe jpeg
thank you very much for the helps and attentions
regards,
david sugandi
Re: How to scan multiformat multipage document at once time
Hi,
You can try to decrease the value of the threshold parameter of the IsBlank() method: https://www.gdpicture.com/guides/gdpicture/v5/gdpictur ... Blank.html
Loïc
You can try to decrease the value of the threshold parameter of the IsBlank() method: https://www.gdpicture.com/guides/gdpicture/v5/gdpictur ... Blank.html
Loïc
Re: How to scan multiformat multipage document at once time
yes the code work proper
but how about the file compression method
i need the file compression for both tiff and pdf
combine in the previous code
thank you
but how about the file compression method
i need the file compression for both tiff and pdf
combine in the previous code
thank you
Re: How to scan multiformat multipage document at once time
All is into the documentation Davis.
See the different mode of compression available and try they: https://www.gdpicture.com/guides/gdpicture/v5/gdpictur ... iPage.html
Loïc
See the different mode of compression available and try they: https://www.gdpicture.com/guides/gdpicture/v5/gdpictur ... iPage.html
Loïc
Re: How to scan multiformat multipage document at once time
yeah, i already try them but it not fit with my need
the file compression still made the result in big size
i try the all compression that described in the documentation
so might you tell me the other compression method
maybe like jpeg or else
thank you
the file compression still made the result in big size
i try the all compression that described in the documentation
so might you tell me the other compression method
maybe like jpeg or else
thank you
Re: How to scan multiformat multipage document at once time
Hi,
If you want to compress as jpeg you have to use the SaveAsJpeg() method.
Please, check the documentation at "Save and Close Image", it describe all the image formats and compressions you can use.
Best regards,
Loïc
If you want to compress as jpeg you have to use the SaveAsJpeg() method.
Please, check the documentation at "Save and Close Image", it describe all the image formats and compressions you can use.
Best regards,
Loïc
Re: How to scan multiformat multipage document at once time
Loic,
thank very much
best regards,
david sugandi
thank very much
best regards,
david sugandi
Who is online
Users browsing this forum: No registered users and 1 guest