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 - Get link coordinates and target
  FAQ FAQ  Forum Search   Register Register  Login Login

Get link coordinates and target

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

Joined: 24 Jun 07
Location: Yugoslavia
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote bboldi Quote  Post ReplyReply Direct Link To This Post Topic: Get link coordinates and target
    Posted: 12 Sep 07 at 6:19AM
Does QPDF has any function that helps me get the links from a page (tarket -> inner or extern - http or mailto) , and the Rect of the link (x,y,w,h)... I would like to create clickable areas for the rendered page... Thanks for the help in advance.
Back to Top
marian_pascalau View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 28 Mar 06
Location: Germany
Status: Offline
Points: 278
Post Options Post Options   Thanks (0) Thanks(0)   Quote marian_pascalau Quote  Post ReplyReply Direct Link To This Post Posted: 12 Sep 07 at 8:56AM

Yes there are functions for this purpose. This is a small code snipped which may give you some clues:

 
    nCount := Pdf.AnnotationCount;
    for nIndex := 1 to nCount do
    begin
        try
            strPrp := string(Pdf.GetAnnotStrProperty(nIndex, 101));
            if CompareText(strPrp, 'Link') <> 0 then
                Continue;
            rect  := RectangleF(
                Pdf.GetAnnotDblProperty(nIndex, 105),
                Pdf.GetAnnotDblProperty(nIndex, 106),
                Pdf.GetAnnotDblProperty(nIndex, 107),
                Pdf.GetAnnotDblProperty(nIndex, 108));
            if not Contains(rect, point) then
                Continue;
            //Log_MessageFmt('%n:%n:%n:%n - %n:%n', [rect.Left, rect.Top, rect.Left + rect.Width, rect.Top + rect.Height, point.X, point.Y]);
            MessageBeep(MB_ICONEXCLAMATION);
            case Pdf.GetAnnotIntProperty(nIndex, 111) of
            0, 1:
              begin
                intDst := Pdf.GetAnnotIntProperty(nIndex, 112);
                if intDst > 0 then
                begin
                    {$IFDEF _DEBUG}
                    intDst := Pdf.GetDestPage(intDst);
                    LogMessageFmt('Link[%d]->GotoPage: %d', [nIndex, intDst]);
                    {$ENDIF}
                end;
              end;
            4, 6:
              begin
                strDst := Pdf.GetAnnotStrProperty(nIndex, 112);
                {$IFDEF _DEBUG}
                LogMessageFmt('Link[%d]->Launch: %s', [nIndex, strDst]);
                {$ENDIF}
              end;
            end;
        except
        end;
    end;
Best regards, Marian
Back to Top
bboldi View Drop Down
Beginner
Beginner
Avatar

Joined: 24 Jun 07
Location: Yugoslavia
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote bboldi Quote  Post ReplyReply Direct Link To This Post Posted: 12 Sep 07 at 10:04AM
Thanks. You helped a lot.
Back to Top
marian_pascalau View Drop Down
Debenu Quick PDF Library Expert
Debenu Quick PDF Library Expert


Joined: 28 Mar 06
Location: Germany
Status: Offline
Points: 278
Post Options Post Options   Thanks (0) Thanks(0)   Quote marian_pascalau Quote  Post ReplyReply Direct Link To This Post Posted: 12 Sep 07 at 10:19AM
You are welcome
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