Code: Select all
Twain1.TwainOpenDefaultSource
Twain1.TwainSetAutoFeed (True)
Twain1.TwainSetAutoScan (True)
If Twain1.TwainPdfOCRStartEx("H:\GdTwainTests\mypdf.pdf") = 0 Then
While Twain1.CreateImageFromTwain(Me.Hwnd) <> 0
Call Twain1.TwainAddGdPictureImageToPdfOCR(Twain1.GetNativeImage, TesseractDictionaryEnglish, "C:\Program Files\GdTwain Pro ActiveX\redist\optional\ocrdata")
Twain1.CloseNativeImage
Wend
Twain1.TwainPdfOCRStop
End If
Twain1.TwainCloseSource
When attempting to run this I get an error message on the line which contains the CreateImageFromTwain method:
Microsoft Visual Basic Run-time error '438': Object doesn't support this property or method.
Also, I cannot find this method in the Reference Guide, yet it is included in the Reference as sample code.
The goal here is to create a searchable PDF file from a scanned single or multi-page document. I am using GdTwain Pro ActiveX since according to the specifications I would be able to do this. I have also included the Twain1.SetLicenseNumberOCRTesseract statement when opening my form. Any assistance would be appreciated.
Sincerely,
Steve