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

Script to create hyperlink based on text

goodzik2
Registered: Feb 12 2009
Posts: 19

Is there a way to write a script that would create a hyperlink based on certain text within a PDF? I have a column in my PDF that is pageserial numbers such as 00100001 and 00100002 and I want to create a link so when 00100001 is clicked it opens up the document c:\00100001.pdf ?

Is this in any way possible? Thanks for any assistance...

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes there is. An Acrobat Automation script can look though the all the words on a page a place a link over any word or group of words. And the link action can open of a PDF file that is at a known location. Look in the Acrobat JavaScript Reference for the "doc.getPageNthWord()" function.

But this is not a simple script. Writing it will require a moderate knowledge of programming.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

try67
Online
Expert
Registered: Oct 30 2008
Posts: 2399
I recently developed a script that does just that. Have a look here:
http://try67.blogspot.com/2009/03/acrobat-add-hyperlinks-to-text.php
Contact me by email if you're interested in it.

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