I am using the following code and getting different results in different environments when run by the same Laserfiche admin user.
LFApplication app = new LFApplication(); LFServer serv = (LFServer)app.GetServerByName("127.0.0.1"); LFDatabase db = (LFDatabase)serv.GetDatabaseByName("RepName"); LFConnection conn = new LFConnection(); conn.Shared = true; conn.UserName = "user"; conn.Password = "pwd"; conn.Create(db); LFDocument lfDoc = (LFDocument)db.GetEntryByID(1759632); LFDocumentPages pages = (LFDocumentPages)lfDoc.Pages; OCREngine ocr = new OCREngine(); ocr.LogFile = @"C:\log.txt"; pages.UnmarkAllPages(); pages.MarkPageByIndex(1); ocr.OCRMarkedPages(pages); conn.Terminate();
When run in an EXE using DocumentProcessor80, the imageis successfully OCR'ed.
When run in an EXE using DocumentProcessor83, this exception is thrown:
Message: ""
ErrorCode: -2147221164
Inner Exception: null
Log Entry: 23-Dec-2015, 16:15:48, [340]: 3596 -
When run from a website in IIS under DocumentProcessor80, this exception is thrown:
Message: "Access is denied."
ErrorCode: -2147221230
Inner Exception: null
Log Entry: none
When run from a website in IIS under DocumentProcessor83, this exception is thrown:
Message: ""
ErrorCode: -2147221164
Inner Exception: null
Log Entry: 23-Dec-2015, 16:22:23, [340]: 13204 -
It appears that the 8.3 version of OCREngine is having problems running OCR either way and that the 8.0 version has a permissions issue when being run via a website, even though the same LF admin user is being used in both scenarios. Are there NTFS permissions involved with using the OCREngine? We would like to be able to launch OCR when a new page is created from the IIS website. What steps can we take to move forward?
The machine I am running on has Laserfiche Client 9.2 installed and can OCR images from the Client window. The DocumentProcessor83.dll version appears to be 8.3.2.685. Please advise if there is additional helpful information I could provide. Thank you.