These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Programmatically adding link on a phrase

ADB
ADB's picture
Registered: Nov 28 2011
Posts: 20
Answered

I want to programmatically generate a link on the page. I have managed to do so with the help of addLink() function. The problem is I am unable to generate links from multiple words/phrases like "Click Here". As soon as there is a blank space character the getNthWord() or getNthWordQuads() function become useless. Is there a way around this? Any help is appreciated. Thank you.

My Product Information:
Acrobat Pro 10.1, Windows
try67
try67's picture
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
getNthWord() doesn't become useless, you just need to be more creative...
If you find the word "Click" you just need to check if the next word after that is "Here". If so, take both of their quads and use them to create your link.

PS - this is not really a 3D question. You should post this kind of questions in the JavaScript forum.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

JoelGeraci
JoelGeraci's picture
ExpertTeam
Registered: Aug 17 2006
Posts: 80
I agree with try67 - you'll need to check the y coordinates of the quads to be sure there isn't a line break but the quads do give you enough information to create a link.
try67
try67's picture
Expert
Registered: Oct 30 2008
Posts: 2398
Even if there's a line break in between the two terms, you can create two separate links (withe the same action)...

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

ADB
ADB's picture
Registered: Nov 28 2011
Posts: 20
thank you try67 I will try this solution and get back. And I will remember about posting threads in the right category, thanks.