Skip to main content
Giraffe19
Participant
November 3, 2016
Answered

Automate adding hyperlinks to a daily pdf

  • November 3, 2016
  • 4 replies
  • 1620 views

I create a pdf every day. The first page is a summary sheet with a list of names followed by some summary data (for example) :

A:      123232 xyz 100%

B:      121311 vgf 75%

C:      234525 jkl 89%

Then page two is a full detailed look at "A", page 3 a look at "B" etc. (There's about 30 of these)

I want to call a program to add hyperlinks to A, B, and C on the first summary page, that will take you to the corresponding detailed pages (so you click on "A" on page one, and it will take you to page 2, which has a back button to go back to page 1)

I have tried adding the links in excel when we make the report, and that's a whole other nightmare when printing to a pdf. So I figured I would look into automating the addition of hyperlinks through Adobe once it is already a pdf, rather than using excel.

Any thoughts or tips on how to do this would be greatly appreciated.

This topic has been closed for replies.
Correct answer try67

In that case you can simply use the addField or addLink methods of the Document object to create them, and then the setAction method to set them to point to a specific page. These methods are all documented in the Acrobat JS Reference, with examples.

4 replies

try67
Community Expert
Community Expert
November 3, 2016

Are the locations of the links on the page and their targets always the

same?

Giraffe19
Giraffe19Author
Participant
November 4, 2016

Yes, they will always be in the same place on page one and in the same order throughout.

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 4, 2016

In that case you can simply use the addField or addLink methods of the Document object to create them, and then the setAction method to set them to point to a specific page. These methods are all documented in the Acrobat JS Reference, with examples.