Page 1 of 1

[VB.NET/C#] OCR a specific Zone of a PDF page

Posted: Tue Jul 26, 2011 4:56 pm
by Loïc

Re: OCR a specific Zone of a PDF page

Posted: Thu Sep 06, 2012 9:09 pm
by rpicilli
Hi Loïc, how are you?

This solves part of the problem. Could you help me with the following?

I need to visualize the document so I'll load into a GDViewer.
I need to use the Thumbnails too.
The document could have more than one Page.
The ROI will be set on the GDViewer

I've try all the possibilities but the correct one (I don't know what it is)

How can I do that?

Again, can you help me?

Regards

Rogerio Picilli

Re: OCR a specific Zone of a PDF page

Posted: Fri Sep 14, 2012 11:29 am
by Loïc
Hello Roger,

You have to do the following:

- From the GdViewer, extract coordinate of the rectangle of selection in inches. See: GetRectCoordinatesOnDocumentInches() method.
- Then convert the coordinates to pixel, according to the resolution used to rasterize the page.

This should be something like this, for 200 DPI rendering:

Code: Select all

GdViewer1.GetRectCoordinatesOnDocumentInches(left, top, width, height)
RasterPageID = oGdPicturePDF.RenderPageToGdPictureImage(200, True)
oGdPictureImaging.SetROI(left * 200, top * 200, width * 200, height * 200)
Hope this helps!

Kind regards,

Loïc

Re: [VB.NET/C#] OCR a specific Zone of a PDF page

Posted: Sat Mar 26, 2016 10:38 am
by fs051268
Hi,

the link in the initial post is broken. Can you please give me the new link to the sample?
Thanks.

Re: [VB.NET/C#] OCR a specific Zone of a PDF page

Posted: Sun Mar 27, 2016 2:28 pm
by Loïc
updated!

Re: [VB.NET/C#] OCR a specific Zone of a PDF page

Posted: Wed Nov 22, 2017 11:59 am
by Gabriela
Here you can find updated code snippet based on GdPicture.NET 14:

How to OCR a specific zone of a PDF document