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 - "Phantom" Images
  FAQ FAQ  Forum Search   Register Register  Login Login

"Phantom" Images

 Post Reply Post Reply
Author
Message
John Whitham View Drop Down
Beginner
Beginner


Joined: 20 Apr 16
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote John Whitham Quote  Post ReplyReply Direct Link To This Post Topic: "Phantom" Images
    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?
Back to Top
John Whitham View Drop Down
Beginner
Beginner


Joined: 20 Apr 16
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote John Whitham Quote  Post ReplyReply Direct Link To This Post Posted: 04 Oct 18 at 4:44PM
Replying to myself as no edit function: Delphi 10.2.3 Tokyo and QuickPDF 13.12
Back to Top
John Whitham View Drop Down
Beginner
Beginner


Joined: 20 Apr 16
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote John Whitham Quote  Post ReplyReply Direct Link To This Post Posted: 04 Oct 18 at 5:49PM
Solved it! pdfdoc.GetImageListItemIntProperty(imgl,i,401) returns 1 on a cleared image so it can be discounted.
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