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

Example requests & Code samples for GdPicture Toolkits.
Post Reply
User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

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

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


rpicilli
Posts: 50
Joined: Fri Nov 25, 2011 12:39 pm

Re: OCR a specific Zone of a PDF page

Post by rpicilli » Thu Sep 06, 2012 9:09 pm

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: OCR a specific Zone of a PDF page

Post by Loïc » Fri Sep 14, 2012 11:29 am

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

fs051268
Posts: 25
Joined: Wed May 22, 2013 4:00 pm

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

Post by fs051268 » Sat Mar 26, 2016 10:38 am

Hi,

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

User avatar
Loïc
Site Admin
Posts: 5881
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

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

Post by Loïc » Sun Mar 27, 2016 2:28 pm

updated!

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

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

Post by Gabriela » Wed Nov 22, 2017 11:59 am

Here you can find updated code snippet based on GdPicture.NET 14:

How to OCR a specific zone of a PDF document

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest