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!
"Phantom" Images |
Post Reply |
Author | |
John Whitham
Beginner Joined: 20 Apr 16 Status: Offline Points: 5 |
Post Options
Thanks(0)
Posted: 04 Oct 18 at 4:38PM |
I use the following code in a MouseUp event on a TPaintbox to find if the user has selected an image in the underlying pdf
...imgl := pdfdoc.GetPageImageList(0); if imgl > 0 then begin dpi := paintbox2.Height / (pdfdoc.PageHeight /25.4); curpos := point(x,y); cx := curpos.X / dpi * 25.4; cy := curpos.Y / dpi * 25.4; for i := 1 to pdfdoc.GetImageListCount(imgl) do begin il := pdfdoc.GetImageListItemDblProperty(imgl,i,501); it := pdfdoc.GetImageListItemDblProperty(imgl,i,502); ir := pdfdoc.GetImageListItemDblProperty(imgl,i,503); ib := pdfdoc.GetImageListItemDblProperty(imgl,i,506); if (cx >= il) and (cx <= ir) and (cy >= it) and (cy <= ib) then break; end; if i <= pdfdoc.GetImageListCount(imgl) then... this works fine initially, but after calling pdfdoc.ClearImage() on some moved or deletedimages it starts finding images where there are none. I suspect it finds where they used to be. Can anyone confirm this?
|
|
John Whitham
Beginner Joined: 20 Apr 16 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Replying to myself as no edit function: Delphi 10.2.3 Tokyo and QuickPDF 13.12
|
|
John Whitham
Beginner Joined: 20 Apr 16 Status: Offline Points: 5 |
Post Options
Thanks(0)
|
Solved it! pdfdoc.GetImageListItemIntProperty(imgl,i,401) returns 1 on a cleared image so it can be discounted.
|
|
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