Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Getting Image information: Page, X/Y Location?

Question

I just started using the QuickPDF library, and I am working with extracted text and images. Text extraction works great for the selected page, however finding out if an image is on the page is less straightforward. I'm using LoadFromFile() for now...

I can use the ImageCount(), GetImageID(), and SelectImage() functions to iterate through the images in the PDF file and get the raw data. However, there don't seem to be functions like ImagePage, ImageX, or ImageY to indicate what page the image is on or its actual placement.

I do see some options for getting the page number. Using DAGetPageImageList() I could iterate through the image list using DA functions. Or I could extract a page at a time from the PDF to see if any images are on it. Both seem a little roundabout, and neither solution helps me with the X/Y placement of one (or more) images.

Answer

We will be adding the image X,Y, W, H locations in the next version or so of the Quick PDF Library. Most likely version 8.

What makes this tricky is that images are stored a resources and these resources are drawn onto the page when required. One image resource could be used hundreds of times in the same PDF. To find a list of all images used we need to use the full rendering code to capture and record the image locations.

As mentioned we will be improving this in future releases.

Please contact us if you have a specific requirement as there may be other ways to achieve the same thing.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum