Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, September 6, 2010 3:59:38 AM(UTC)

yuvalDS  
yuvalDS

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
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, September 7, 2010 2:44:26 AM(UTC)

Adnan Ismail  
Guest

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.082 seconds.