replied on November 13, 2018
Another option is to use the LF SDK, if you have developer resources. Here is a sample program that finds all documents with the "Needs OCR" field set to "Yes" and OCRs them:
using System;
using Laserfiche.RepositoryAccess;
using Laserfiche.DocumentServices;
namespace BatchOCR
{
class Program
{
static void Main(string[] args)
{
string server = "LFServerName"; // server name here
string repository = "MyRepoName"; // repository name here
string username = ""; // username here
string password = ""; // password here
try
{
RepositoryRegistration rr = new RepositoryRegistration(server, repository);
using (Session session = new Session())
{
if (!string.IsNullOrEmpty(username))
session.LogIn(username, password, rr);
else
session.LogIn(rr);
using (Search search = new Search(session, @"{[]:[Needs OCR]=""Yes""}"))
{
search.Run();
SearchListingSettings settings = new SearchListingSettings();
using (SearchResultListing listing = search.GetResultListing(settings))
{
foreach (EntryListingRow row in listing)
{
int entryId = (int)row[SystemColumn.Id];
try
{
using (EntryInfo en = Entry.GetEntryInfo(entryId, session))
{
if (en.EntryType == EntryType.Document)
{
DocumentInfo doc = (DocumentInfo)en;
doc.Lock(LockType.Exclusive);
Console.WriteLine(String.Format("OCRing {0}", en.Path));
using (OcrEngine ocrEngine = OcrEngine.LoadEngine())
{
ocrEngine.Run(doc);
}
FieldValueCollection fvc = doc.GetFieldValues();
fvc.Remove("Needs OCR");
doc.SetFieldValues(fvc);
doc.Save();
}
}
}
catch (LockedObjectException)
{
// Another bot is probably OCRing the document
}
}
}
}
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}
}
To use this, create a list field named "Needs OCR". Run a search in the LF client that returns all of the documents you want to OCR, select them all and set this field to "Yes" on them. Then you can run this program to do a batch OCR. Run it on multiple machines simultaneously to speed up the process. This uses the .NET SDK, I tested with 10.3.