Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Can you get an ImageID from an ImageList?
  FAQ FAQ  Forum Search   Register Register  Login Login

Can you get an ImageID from an ImageList?

 Post Reply Post Reply
Author
Message
ChrisH View Drop Down
Beginner
Beginner
Avatar

Joined: 19 Sep 12
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote ChrisH Quote  Post ReplyReply Direct Link To This Post Topic: Can you get an ImageID from an ImageList?
    Posted: 19 Sep 12 at 4:51PM
Is there anyway to get the ImageID of an image in an ImageList returned from GetPageImageList that can be used with SelectImage?

What I'm looking to do is retrieve the image's resolution (dpi) to calculate the print size of the images that belong to a specified page. While GetImageListItemIntProperty will return the pixel size, it won't return the resolution information.

I think this is an area of missing functionality, the GetImageListItemIntProperty should support a way of returning the ImageID to be used with all of the other image handling functions.

Thanks.
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3530
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post Posted: 19 Sep 12 at 7:41PM
Hi Chris!

If this is a missing functionality you should
post your question on the official support-pages
from the publishers. Here it's the user-user-forum ;-)

Cheers and welcome here,
Ingo

Back to Top
ChrisH View Drop Down
Beginner
Beginner
Avatar

Joined: 19 Sep 12
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote ChrisH Quote  Post ReplyReply Direct Link To This Post Posted: 19 Sep 12 at 7:50PM
Thanks I'll do that. I was hoping I was just completely overlooking how to do it :)
Back to Top
AndrewC View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 08 Dec 10
Location: Geelong, Aust
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndrewC Quote  Post ReplyReply Direct Link To This Post Posted: 20 Sep 12 at 6:11AM
Good question.

We have two functions in QPL for finding images and they work in different ways.

FindPages() and GetPageImageList()

1. FindPages will search through the Resources dictionary for each image on the page and then report back each image object/stream that was found in the PDF.  It will only report the image once even if the image is used many times on the same page or on multiple pages.  It cannot tell you if the image is used or not, cannot tell you exactly on which page it it used or even the size it is used at for rendering.  It just reports the raw image properties - it cannot report scaling, rotation etc.  It does have access to the DPI setting of the raw image data.  If you render the image then the DPI used will be different to this DPI as scaling, rotation etc will afftect the actual rendered DPI.

2. GetPageImageList will do a fast render of the current page and report back any and all images that were processed during the quick render process.  If the same logo is used on the top and bottom of the page then this image will be reported twice.

You can use the GetImageListItemIntProperty function to return the image width and height in pixels (option 401 and 402 respectively).  You can also use the GetImageListItemDblProperty to determine the size of bounding box that the image was used to draw the image.  

DPIx =  width in pixels / bbox.width * 72.0;
DPIy =  height in pixels / bbox.width * 72.0;

or

DPIx = GetImageListItemIntProperty(401) / (QP.GetImageListItemDblProperty(503) -  (QP.GetImageListItemDblProperty(501)) ;
DPIy = GetImageListItemIntProperty(402) / (QP.GetImageListItemDblProperty(504) -  (QP.GetImageListItemDblProperty(502)) ;

This is assuming that the image box is not rotated for any reason.

As for getting the ImageID and using it with the other image functions - I will need to do some consulting with the programmers and some testing to see what might be possible in the future.

I hope that helps.  Do you have a reason why you think the ImageID would be good to have or does FindImages solve that problem for you ?

Andrew.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store