This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Monday, September 6, 2010 3:59:38 AM(UTC)
Groups: Registered
Posts: 1
Hello,
I've tried to recognize text via OCR from a PDF file. The PDF contains a scan of a document. The scanned document has text and some pictures in it. the pictures are irrelevant, i'm only interested in the text.
The problem is I got "Unsupported resolution." error on the code below:
_ocrEngine = OcrEngineManager.CreateEngine(OcrEngineType.Plus, False)
_ocrEngine.Startup(Nothing, Nothing, Nothing, Nothing)
_ocrDocument = _ocrEngine.DocumentManager.CreateDocument()
_ocrDocument.Pages.AddPage("c:\MyFile.PDF", Nothing)
_ocrDocument.Pages.Recognize(Nothing) ' I GET THE ERROR ON THIS ROW
_ocrDocument.Save(TextBox2.Text, DocumentFormat.Pdf, Nothing)
System.Diagnostics.Process.Start(TextBox2.Text)
Thank you
#2
Posted
:
Tuesday, September 7, 2010 2:44:26 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
By default our functions load PDF files with 72Dpi, which will trigger the "Unsupported resolution" error when you try to perform OCR on PDF file loaded with such resolution.
You can solve this issue by increasing the loading resolution of PDF files, to do that use an instance of the RasterCodecs class to increase loading PDF resolution and pass this instance the OCREngine.Startup method.
You can use code like this:
/****************/
Leadtools.Codecs.RasterCodecs codecs = new Leadtools.Codecs.RasterCodecs();
codecs.Options.Pdf.Load.XResolution = 300;
codecs.Options.Pdf.Load.YResolution = 300;
ocrEngine.Startup(codecs, null, null, null);
/****************/
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.