Skip to main content
SNAdobeQuestions
Participant
June 26, 2018
Question

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

  • June 26, 2018
  • 2 replies
  • 809 views

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 has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
June 26, 2018
Acrobate du PDF, InDesigner et Photoshopographe
SNAdobeQuestions
Participant
June 26, 2018

Hi JR_Boulay,

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

try67
Community Expert
Community Expert
June 26, 2018

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?

SNAdobeQuestions
Participant
June 26, 2018

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.

try67
Community Expert
Community Expert
June 26, 2018

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