PDA

View Full Version : How to get the text of link in pdf file?


bookworm
June 2nd, 2006, 03:28 PM
To get the Handle of a link, we use functions FPDFLink_GetLinkAtPoint() and FPDFLink_GetDest(). Now, Instead of getting the Handle, I want to get the text of this link. How?

Razvan
June 5th, 2006, 06:14 AM
i don't know how to get the actual text, but you can FPDFAction_GetURIPath for the uri path if you want to handle an url click:

Something like this:

FPDF_LINK Link=FPDFLink_GetLinkAtPoint(Page,PageX,PageY);
if (Link>0)
{
FPDF_ACTION action;
char uri[255];
action=FPDFLink_GetAction(Link);
FPDFAction_GetURIPath(Doc,action,uri,255);
MessageBox(0,uri,"the link text",MB_OK);
}

bookworm
June 5th, 2006, 06:17 AM
Thanks. I will try :1_30: