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

New Here ,
Jun 26, 2018 Jun 26, 2018

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!

TOPICS
Acrobat SDK and JavaScript

Views

123

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jun 26, 2018 Jun 26, 2018

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?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 26, 2018 Jun 26, 2018

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.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jun 26, 2018 Jun 26, 2018

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

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 26, 2018 Jun 26, 2018

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!

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jun 26, 2018 Jun 26, 2018

Copy link to clipboard

Copied

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 26, 2018 Jun 26, 2018

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?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines