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!
![]() |
Get link coordinates and target |
Post Reply ![]() |
Author | |
bboldi ![]() Beginner ![]() ![]() Joined: 24 Jun 07 Location: Yugoslavia Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() 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.
|
|
![]() |
|
marian_pascalau ![]() Debenu Quick PDF Library Expert ![]() Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
bboldi ![]() Beginner ![]() ![]() Joined: 24 Jun 07 Location: Yugoslavia Status: Offline Points: 11 |
![]() ![]() ![]() ![]() ![]() |
Thanks. You helped a lot.
|
|
![]() |
|
marian_pascalau ![]() Debenu Quick PDF Library Expert ![]() Joined: 28 Mar 06 Location: Germany Status: Offline Points: 278 |
![]() ![]() ![]() ![]() ![]() |
You are welcome
|
|
![]() |
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