I keep getting an object variable or with block....... error when calling ocr.process.
I've modified the demo a bit as it's not valid code.
Can you please tell me what I'm missing....
Private Sub Button7_Click(sender As System.Object, e As System.EventArgs) Handles Button7.Click
' resource file
Const resourceFileName As String = "e:\2011.07.02 v1.0 Aspose.OCR.Resouces.zip"
' image document on which OCR is to be performed
Dim imageFile As String = "e:\wordtest.tiff"
Console.WriteLine("Performing OCR on " & imageFile & "....")
' Initialize OcrEngine
Dim ocr As Aspose.OCR.OcrEngine = New Aspose.OCR.OcrEngine()
' Set the image
Dim iom As New IO.MemoryStream(IO.File.ReadAllBytes(imageFile))
iom.Position = 0
ocr.Image = Aspose.OCR.ImageStream.FromMemoryStream(iom, Aspose.OCR.ImageStreamFormat.Tiff)
' Add language
ocr.Languages.AddLanguage(Aspose.OCR.Language.Load("english"))
ocr.Config.NeedRotationCorrection = False
ocr.Config.UseDefaultDictionaries = True
'ocr.Config.di
' Load the resource file
ocr.Resource = New System.IO.FileStream(resourceFileName, System.IO.FileMode.Open)
Try
' Process the whole image
If ocr.Process() Then
' Get the complete recognized text found from the image
Console.WriteLine("Text recognized./n" + ocr.Text.ToString)
End If
Catch ex As Exception
Console.WriteLine("Exception: " & ex.Message)
End Try
End Sub