Copy link to clipboard
Copied
Hi,
I want to find a method that would replace all the occurrences of a given word within the PDF file, with a hyperlink that would take me to another page on the same PDF file. I am working with Adobe Acrobat, and it appears that Javascript is needed to perform the action. I don't have a lot of experience in Javascript, so If I can get some assistance and direction, that would be greatly appreciated!
Thank you!
Copy link to clipboard
Copied
You can't use JS to replace text in a PDF file, but you can use it to place a transparent link on top of all the occurrences of a specific word that performs a specific action (also using JS) when clicked. Is that what you mean?
Copy link to clipboard
Copied
Hi try67,
That would achieve my end goal, which is to have the user click on a certain text, and have it bring them to the linked page. How would I go about doing what you have suggested?
Thank you for the fast response.
Copy link to clipboard
Copied
That would require writing a not very simple script, especially if the text in question is more than one word. Basically you would need to use a loop that iterates over all the pages in the file, then another loop that iterates over the words in each page. If a match is found you need to get the word's quads, convert them to a rect and then add a link or a field on that location. As I said, it's not a very simple task.
If you're interested, I've developed a (paid-for) tool that allows you to do it quite easily: Custom-made Adobe Scripts: Acrobat -- Create Custom Links from Text
Copy link to clipboard
Copied
Hi try67,
I will look into the subject a little more. Thank you again for providing me with a general direction to move in!
Copy link to clipboard
Copied
My free Hyperlink Maker was made for you: https://www.abracadabrapdf.net/utilitaires/utilities-in-english/hyperlink-maker-eng/
Copy link to clipboard
Copied
Hi JR_Boulay,
Thank you for the link! Can it link to a particular page on a PDF file instead of an URL?