Extracting an image from a pre-defined area of the PDF

Discussions about PDF management.
Post Reply
duska
Posts: 1
Joined: Mon Nov 26, 2018 6:49 pm

Extracting an image from a pre-defined area of the PDF

Post by duska » Mon Nov 26, 2018 7:03 pm

Hi there!

So I installed the SDK and tried out the demos and was very impressed, especially with the OCR demo, which is exactly what my company needs. With the SDK is it also possible to extract images from a predefined box (exactly like it works with text)? So basically the exact same thing as OCR, but images...

jamesin8
Posts: 2
Joined: Mon Jan 14, 2019 3:15 am

Re: Extracting an image from a pre-defined area of the PDF

Post by jamesin8 » Mon Jan 14, 2019 3:19 am

Any updates on this functionality?

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

Re: Extracting an image from a pre-defined area of the PDF

Post by Loïc » Tue Jan 15, 2019 11:00 am

Hello,

I can see several option depending what you really need to achieve.

1- If you want to extract a full embedded image, drawn in a specific rectangle:

- Loop to all images in the page, extracting they coordinates. Please use the GetPageImageCoordinates() method. see: https://www.gdpicture.com/guides/gdpicture/web ... nates.html
- If the coordinates are located within the rectangle, extract this image. This can be done using the ExtractPageImage() method. see:
https://www.gdpicture.com/guides/gdpicture/web ... Image.html

2- If you want to capture the region of a page:

- Rasterize the page to a GdPicture image. Please use the method RenderPageToGdPictureImage(). See: https://www.gdpicture.com/guides/gdpicture/web ... Image.html

- Extract the region of the rendered bitmap. For such pourpose you may want to use the GdPictureImaging class and its CreateClonedGdPictureImageArea() method. See:
https://www.gdpicture.com/guides/gdpicture/web ... eArea.html

I hope this helps.

Please just let us know if you need further information or assistance.

With best regards,

Loïc Carrère

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests