I am using Leadtools OCR
I referenced the following DLLS:
Leadtools.dll
Leadtools.Barcode.oneD.dll
Leadtools.codecs.dll
Leadtools.codecs.fax.dll
Leadtools.codecs.png.dll
Leadtools.codecs.tif.dll
Leadtools.Forms.DocumentWriters.dll
Leadtools.forms.ocr.dll
Leadtools.forms.ocr.Advantage.dll
And the following code to convert a Png file to Pdf
private void button1_Click(object sender, EventArgs e)
{
try
{
string sourceFile = @"C:\Users\cf\Desktop\OcrTest\Images\Capture.PNG";
string targetFile = Path.ChangeExtension(sourceFile, "pdf");
using (IOcrEngine ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Advantage, false))
{
ocrEngine.Startup(null, null, null, @"C:\LEADTOOLS 19\Bin\Common\OcrAdvantageRuntime");
ocrEngine.AutoRecognizeManager.Run(sourceFile, targetFile, Leadtools.Forms.DocumentWriters.DocumentFormat.Pdf, null, null);
Process.Start(targetFile);
}
}
catch (OcrSupportLockedException ex)
{
Console.WriteLine("Support is locked. You need to unlock '{0}' in this engine to use this feature", ex.SupportType);
}
catch (OcrException ex)
{
Console.WriteLine("OCR Error\nCode: {0}\nMessage:{1}", ex.Code, ex.Message);
}
catch (RasterException ex)
{
Console.WriteLine("LEADTOOLS Error\nCode: {0}\nMessage:{1}", ex.Code, ex.Message);
}
catch (Exception ex)
{
Console.WriteLine("System Error\nMessage:{0}", ex.Message);
}
}
The following line is returning an OcrException
Ocr Not Enabled
With the code: -1760
I cant figure out why this is happening
Any help would be appreciated