I am trying to get some code that OCRs a document to work as expected. The program works perfectly on the development computer, but fails out on "ocr.OCRMarkedPages(docPages)" on a test machine. Initially I had it set the OCR optimization to speed, but that caused an error so I fell back to other methods to get it past that point on the test machine.
Sub OCR(ByVal newDocument As LFDocument)
Do
WriteEvent("Setup ocr engine.")
Dim ocr As New OCREngine
Try
WriteEvent("Set optimization mode.")
Try
ocr.OptimizationMode = OCR_Optimization_Mode.OCR_OPTIMIZATION_SPEED
Catch ex As Exception
Try
ocr.OptimizationMode = OCR_Optimization_Mode.OCR_OPTIMIZATION_BALANCED
Catch ex2 As Exception
Try
ocr.OptimizationMode = OCR_Optimization_Mode.OCR_OPTIMIZATION_ACCURACY
Catch ex3 As Exception
WriteEvent("Tried set OCR Optimization mode 3 times..." & vbCrLf & ex.Message & vbCrLf & ex2.Message & vbCrLf & ex3.Message & vbCrLf & "Leaving as default.")
End Try
End Try
End Try
WriteEvent("Get number of pages.")
Dim docPages As LFDocumentPages = newDocument.Pages
WriteEvent("Mark pages.")
docPages.MarkAllPages()
WriteEvent("Start OCR.")
ocr.OCRMarkedPages(docPages)
WriteEvent("Finished OCR.")
Exit Do
Catch ex As Exception
WriteEvent(ex.Message, EventLogEntryType.Error)
If ocr.OCRIsAvailable = False Then
WriteEvent("OCR Is Not Available...", EventLogEntryType.Error)
Exit Do
End If
End Try
Loop While True
End Sub
The LF 10 SDK Runtime is installed on the test machine. The ex.Message which is put to the Event log has no text. I can run the OCR from the client without any problems. Any ideas where to check?
Thanks.