PRIVATE Imaging1
Imaging1 = CREATEOBJECT("gdtwainpro.twain")
If Imaging1.TwainOpenDefaultSource()
Imaging1.SetLicenseNumber('xxx')
Imaging1.TwainSetAutoFeed (.t.)
Imaging1.TwainSetAutoScan (.t.)
Imaging1.TwainSetCurrentResolution (300)
Imaging1.TwainSetCurrentPixelType (1)
Imaging1.TwainSetCurrentBitDepth (8)
Imaging1.TwainPdfStart ("output.pdf")
DO Whil Imaging1.CreateImageFromTwain(Me.hWnd) <> 0
nImageID = Imaging1.GetNativeImage
Imaging1.TwainAddGdPictureImageToPdf(nImageID)
Imaging1.CloseImage (nImageID)
endd
Imaging1.TwainPdfStop
Imaging1.TwainCloseSource
MsgBox "Done !"
Else
MsgBox "can't open default source, twain state is: " & Trim(Str(Imaging1.TwainGetState))
End IfoTwain = CREATEOBJECT("gdtwainpro2.twain")
WITH oTwain as gdtwainpro2.twain
.SetLicenseNumber('xxx')
If .TwainOpenDefaultSource()
.TwainSetAutoFeed (.t.)
.TwainSetAutoScan (.t.)
.TwainSetCurrentResolution (300)
.TwainSetCurrentPixelType (1)
.TwainSetCurrentBitDepth (8)
.TwainPdfStart ("output.pdf")
DO WHILE .TwainAcquireToGdPictureImage <> 0
nImageID = .GetNativeImage
.TwainAddGdPictureImageToPdf(nImageID)
.CloseImage (nImageID)
.TwainPdfStop
ENDDO
.TwainCloseSource
MESSAGEBOX("Done.")
ELSE
MESSAGEBOX("Can't open default source.")
ENDIF
ENDWITHReturn to GdTwain [Pro] ActiveX
Users browsing this forum: No registered users and 1 guest