Loading...

multipage files acquisition with adding page confirmation

Example requests & Code samples for legacy GdPicture products (V 1-2-3-4-5 Series).

multipage files acquisition with adding page confirmation

Postby charuvas1 » Wed Dec 03, 2008 1:38 pm

Hi,

Thank you for the prompt reply to my previous post. I hv another question for you. While scanning, I want all the pages to go to a single file untill user says not to. Following would be the algorithm for it-

1) open default scanner
2) start multipage file
3) scan and save all the pages in the feeder
4) ask the user whether he want to scan more pages.
5) if yes..then go back to step 1 else close the multipage file and scanner.

The multipage files could be pdf or tiff.

Thank you
Charu Vasudev
charuvas1
 
Posts: 34
Joined: Tue Dec 02, 2008 1:49 pm

Re: multipage files acquisition with adding page confirmation

Postby Loïc » Mon Dec 08, 2008 2:40 pm

Hi,

Here a vb6 sample to acquire image from document feeder & asking to the user to acquire other pages when the feeder is empty:


Code: Select all
   Dim nImageID As Long
   Dim bContinue As Boolean
   
   bContinue = True
   Imaging1.SetLicenseNumber ("XXX")
   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")
     Imaging1.TwainDisableAutoSourceClose (True)
     
      Do
       nImageID = Imaging1.TwainAcquireToGdPictureImage(Me.hWnd)
       If nImageID <> 0 Then
          Call Imaging1.TwainAddGdPictureImageToPdf(nImageID)
          Imaging1.CloseImage (nImageID)
       End If
       If Imaging1.TwainGetState <= 5 Then
 
         If MsgBox("Do you want to scan other image ?", vbYesNo, "") <> 6 Then
            bContinue = False
         End If
       End If
       
      Loop While bContinue
     
      Imaging1.TwainPdfStop
      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
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4430
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to Example requests for Gdpicture V 1-2-3-4-5 Series [Legacy]

Who is online

Users browsing this forum: No registered users and 0 guests

cron