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!
![]() |
Can you get an ImageID from an ImageList? |
Post Reply
|
| Author | |
ChrisH
Beginner
Joined: 19 Sep 12 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Ingo
Moderator Group
Joined: 29 Oct 05 Status: Offline Points: 3530 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
ChrisH
Beginner
Joined: 19 Sep 12 Status: Offline Points: 2 |
Post Options
Thanks(0)
Quote Reply
Posted: 19 Sep 12 at 7:50PM |
|
Thanks I'll do that. I was hoping I was just completely overlooking how to do it :)
|
|
![]() |
|
AndrewC
Moderator Group
Joined: 08 Dec 10 Location: Geelong, Aust Status: Offline Points: 841 |
Post Options
Thanks(0)
Quote Reply
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.
|
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store