PaperSize

Discussions about TWAIN & WIA scanning in GdPicture.NET using GdPictureImaging.
Post Reply
RTCaylor
Posts: 4
Joined: Wed Jul 08, 2009 3:59 pm

PaperSize

Post by RTCaylor » Tue Feb 09, 2010 9:43 pm

I am using an HP Officejet J6480 for scanning. When I use the automatic document feeder, I am always getting a legal sized document instead of the letter sized document I requested. Any ideas as to why? Here is my code...

Code: Select all

If theScanner.TwainOpenDefaultSource() Then
    
    done = False
    page = 0

    filePathname = GetTempPath() & "\" & "ScanTestFullDocument" & testNumber & ".pdf"
    pageBasePathname = GetTempPath() & "\" & "ScanTestDoc" & testNumber & "Page"

    UpdateStatus "Configure theScanner..."

    With theScanner
      .TwainSetHideUI True
      .TwainSetCurrentResolution 150
      .TwainSetCurrentPixelType TWPT_GRAY
      .TwainSetCurrentBitDepth (8)
      .TwainSetAutoFeed True
      .TwainSetAutoScan False
      .TwainSetAutoSize False
      .TwainSetAutomaticDeskew False
      .TwainSetPaperSize USLETTER

    End With

    UpdateStatus "TwaindPdfStartEx..."

    If theScanner.TwainPdfStartEx(filePathname) = 0 Then

      While Not done
      
        page = page + 1

        UpdateStatus "TwainAcquireToGdPictureImage Page " & page & " ..."
        
        If theScanner.TwainAcquireToGdPictureImage(hwnd) = 0 Then
          done = True
        Else

          theViewer.SetNativeImage (theScanner.GetNativeImage())
          theViewer.ImageClosed

          pageThisPathname = pageBasePathname & page & ".pdf"

          theScanner.SaveAsPDFEx pageThisPathname

          UpdateStatus "TwainAddGdPictureImageToPdf Page " & page & " ..."

          theScanner.TwainAddGdPictureImageToPdf (theScanner.GetNativeImage)
          theScanner.CloseNativeImage
          
        End If

      Wend

      UpdateStatus "TwainPdfStop, Page Count = " & page
      theScanner.TwainPdfStop

    End If

    UpdateStatus "TwainCloseSource, Page Count = " & page
    theScanner.TwainCloseSource
    
    UpdateStatus "Done, Page Count = " & page
    
  Else
    UpdateStatus "TwainOpenDefaultSource failed."
  End If

RTCaylor
Posts: 4
Joined: Wed Jul 08, 2009 3:59 pm

Re: PaperSize

Post by RTCaylor » Tue Feb 23, 2010 8:36 pm

We have one of our users that is also having a similar problem like this using the application we developed based on your control (don't have the make and model of the scanner he is using). Things are fine when he scans from the platen, but gets messed up when using the automatic document feeder. If he opens the driver UI the default paper size is A4. If he simply changes to 8.5x11 then the scans look good. I've attached the two documents so you can see what is going on.
Attachments
Scans.zip
Zip containing good and bad PDFs.
(151.4 KiB) Downloaded 350 times

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

Re: PaperSize

Post by Loïc » Wed Feb 24, 2010 9:50 am


Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests