Skip to main content
SNAdobeQuestions
Participant
Jun 26, 2018 2:41 PM UTC
Question

Replacing certain words within a PDF with hyperlinks to another page in the same PDF

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!

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

JR Boulay
Community Expert
Community Expert
Jun 26, 2018 5:36 PM UTC
Acrobate du PDF, InDesigner et Photoshopographe
SNAdobeQuestions
Participant
Jun 26, 2018 9:01 PM UTC

Hi JR_Boulay,

Thank you for the link! Can it link to a particular page on a PDF file instead of an URL?

Translate
try67
Community Expert
Community Expert
Jun 26, 2018 3:10 PM UTC

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?

Translate
SNAdobeQuestions
Participant
Jun 26, 2018 3:15 PM UTC

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.

Translate
try67
Community Expert
Community Expert
Jun 26, 2018 3:32 PM UTC

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

Translate