I've been using the GdTwain Pro version of the software in my application. I have upgraded to GdPicture for certain features. I need to accomplish 2 things.
1. To scan and create a PDF file via flatbed or ADF of 1 or more documents.
2. When scanning multiple documents, I want to ask the user after each document if there are additional documents to be scanned, and then create a single PDF from all the scanned documents.
I am modifying my original code as I find differences between the old and the new software. I used to say .TwainOpenDefaultSource() with no parameters, however in the new version a parameter is required. What would the parameter be in VFP?
Thank you for your assistance.
Chaim
Using GdPicture with Visual Foxpro
Re: Using GdPicture with Visual Foxpro
Hello,
Here a vfp sample to acquire document feeder content into a multipage PDF.
Let me know if you have particular questions.
Kind regards,
Loïc
Here a vfp sample to acquire document feeder content into a multipage PDF.
Let me know if you have particular questions.
Code: Select all
PRIVATE oImaging,oGdPicturePDF, ImageID
oImaging = CREATEOBJECT("GdPicture.GdPictureImaging")
oGdPicturePDF = CREATEOBJECT("GdPicture.GdPicturePDF")
WITH oImaging as "GdPicture.GdPictureImaging"
.TwainSelectSource_2(application.hWnd)
.TwainOpenDefaultSource_2(application.hWnd) && You need to call this function before each scan process
.TwainSetHideUI(.F.)
oGdPicturePDF.NewPDF()
DO WHILE .T.
ImageID = .TwainAcquireToGdPictureImage_2(application.hWnd)
If ImageID <> 0 Then
oGdPicturePDF.AddImageFromGdPictureImage(ImageID, .F., .T.)
.ReleaseGdPictureImage(ImageID)
EndIf
IF .TwainGetState() <= 5 &&TWAIN_SOURCE_ENABLED
EXIT
ENDIF
ENDDO
.TwainCloseSource()
oGdPicturePDF.SaveToFile("c:\output.pdf")
oGdPicturePDF.CloseDocument()
ENDWITH
RELEASE oImaging
RELEASE oGdPicturePDF
Loïc
Who is online
Users browsing this forum: No registered users and 1 guest