Scan Multipe Single Pages to 1 PDF

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
uccu
Posts: 10
Joined: Tue Jun 24, 2008 8:31 am

Scan Multipe Single Pages to 1 PDF

Post by uccu » Tue Jul 08, 2008 9:27 pm

Is it possible to scan mulitple duplexed single Page documents into 1 PDF. I am going to guess and say that it is.

Is it as simple as not closing the image file and scanning the next document and then using the TwainAddGdPictureImageToPdf or is it a little more involved?

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Scan Multipe Single Pages to 1 PDF

Post by Loïc » Wed Jul 09, 2008 4:03 pm

Hi,

This is a code snipet to acquire all the document feeder into one multipage pdf file using duplex scanning mode:

Code: Select all

Twain1.TwainOpenDefaultSource
Twain1.TwainSetAutoFeed (True)
Twain1.TwainSetAutoScan (True)
Twain1.TwainEnableDuplex (True)
Twain1.TwainPdfStart ("output.pdf")
While Twain1.TwainAcquireToGdPictureImage(Me.hWnd) <> 0
      Call Twain1.TwainAddGdPictureImageToPdf(Twain1.GetNativeImage)
      Twain1.CloseNativeImage
Wend
Twain1.TwainPdfStop
Call Twain1.TwainCloseSource
Best regards,

Loïc

uccu
Posts: 10
Joined: Tue Jun 24, 2008 8:31 am

Re: Scan Multipe Single Pages to 1 PDF

Post by uccu » Wed Jul 09, 2008 5:30 pm

Loïc

I forgot to mention that there is no Document Feeder on this scanner.

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Scan Multipe Single Pages to 1 PDF

Post by Loïc » Wed Jul 09, 2008 5:40 pm

Hi,

It is the same kind of code:


First Step: Open the Scanner & Initialize the output PDF

Code: Select all

Twain1.TwainOpenDefaultSource
Twain1.TwainEnableDuplex (True)
Twain1.TwainPdfStart ("output.pdf")

Second Step: Acquire each image in duplex mode. Repeat this step for each image to scan

Code: Select all

'Front
Twain1.TwainAcquireToGdPictureImage(Me.hWnd)
Call Twain1.TwainAddGdPictureImageToPdf(Twain1.GetNativeImage)
Twain1.CloseNativeImage

'Back
Twain1.TwainAcquireToGdPictureImage(Me.hWnd)
Call Twain1.TwainAddGdPictureImageToPdf(Twain1.GetNativeImage)
Twain1.CloseNativeImage

Last Step: Save PDF & close the scanner

Code: Select all

Twain1.TwainPdfStop
Call Twain1.TwainCloseSource

Loïc

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest