Home | About us | Overview | Softwares - Downloads | Evaluate | Order | Support | old forums | Contact | F.A.Q. | Documentations | Search | Sitemap

Scan multiple documents at once using separator sheets ?

Example requests & Code samples for GdPicture ActiveX.

Scan multiple documents at once using separator sheets ?

Postby kparker on Wed Feb 13, 2008 3:02 am

I posted this question in a different thread without much reaction; apologies for the duplication. I really need to figure this out before buying GdPicture for our application.
Here is the problem I'm trying to solve.
--->We would like to speed up scanning by feeding the scanner multiple documents at a time (as opposed to feeding the scanner on document at a time).
-->To respect the document boundaries, we insert separator sheets between consecutive documents. The separator sheet will be recognizable through visual patterns.

Does anybody know how I can recognize specific pattern on a scanned image in order to identify the separator sheets on the fly and recognize them as document delimiters?

Thanks

--
kparker
 
Posts: 4
Joined: Fri Feb 08, 2008 9:38 pm

Re: Scan multiple documents at once using separator sheets ?

Postby Loïc on Tue Feb 19, 2008 8:16 pm

Hi,

This (hard) feature will be included withih the next GdPicture V5 release.

I come back ASAP into this topic to give the best way to do that.


Best regards,

Loïc
User avatar
Loïc
Site Admin
 
Posts: 1195
Joined: Tue Oct 17, 2006 11:48 pm
Location: France

Re: Scan multiple documents at once using separator sheets ?

Postby kparker on Wed Mar 19, 2008 8:17 am

I've noticed the promised version 5 is out, and I just ordered a copy. Could you by any chance tell me how to solve this problem with this version?

Thanks.
kparker
 
Posts: 4
Joined: Fri Feb 08, 2008 9:38 pm

Code to Scan multiple documents at once using separator shee

Postby Loïc on Thu Mar 20, 2008 12:42 pm

Hi,

You can use the folowing code to acquire multiple image from a document feeder using a separator sheets.


Notes:

- This code assumes that the first page in the feeder is a separator sheet.
- This code creates multipage PDF files. You can modify it easily in order to acquire into multipage TIFF files.
- This code is working from the GdPicture [PRO] V 5.0.5 :arrow: http://www.gdpicture.com/download.php



Code: Select all
Dim nPDFNo As Long
Dim nImageID As Long
Dim nTemplateSeparator As Long
Dim nCloserTemplate As Long
Dim nCpt As Long
Dim Imaging1 As Object


Set Imaging1 = CreateObject("gdpicturepro5.imaging") 'GdPicture Pro. For GdPicture Light must be "gdpicture4.imaging"
Imaging1.SetLicenseNumber ("YourLicenseKEY")
Imaging1.TwainOpenDefaultSource
Imaging1.TwainSetHideUI (True)
Imaging1.TwainSetAutoFeed (True)  'Set AutoFeed Enabled
Imaging1.TwainSetAutoScan (True) 'To  achieve the maximum scanning rate
     


'First STEP: We create a new document identifier template from a scan of the paper separator
nImageID = Imaging1.CreateImageFromTwain(Me.hWnd)
nTemplateSeparator = Imaging1.ADRCreateTemplateFromGdPictureImage(nImageID)
Imaging1.CloseImage (nImageID)
     
     
'Step 2, Now we will scan all the document feeder into several PDF files (a new PDF is created if a paper separator is detected)
nPDFNo = 1
Imaging1.TwainPdfStart ("output" & Str(nPDFNo) & ".pdf")
While Imaging1.CreateImageFromTwain(Me.hWnd) <> 0
      nCpt = nCpt + 1
      nImageID = Imaging1.GetNativeImage
      nCloserTemplate = Imaging1.ADRGetCloserTemplateForGdPictureImage(nImageID)

      If nCloserTemplate = nTemplateSeparator And Imaging1.ADRGetLastRelevance >= 92 Then
         'A paper separator seems to be detected, we start on a new output PDF
         Imaging1.TwainPdfStop
         nPDFNo = nPDFNo + 1
         Imaging1.TwainPdfStart ("output" & Str(nPDFNo) & ".pdf")
      Else
         Imaging1.TwainAddGdPictureImageToPdf (nImageID)
      End If

      Imaging1.CloseImage (nImageID)
Wend
Imaging1.TwainPdfStop
     
Call Imaging1.TwainCloseSource




Let me know if you have any question regarding this method.

Best regards,

Loïc Carrère
User avatar
Loïc
Site Admin
 
Posts: 1195
Joined: Tue Oct 17, 2006 11:48 pm
Location: France


Return to Example requests & Code samples

Who is online

Users browsing this forum: No registered users and 0 guests