Skip to main content
Participating Frequently
October 19, 2024
Answered

Is there a way to auto open a link when a PDF is loaded?

  • October 19, 2024
  • 1 reply
  • 997 views

I usually just send a link to a google doc or an html file that auto opens it, however some sites require a .pdf file to be submitted and redoing it every time something changes is super annoying

 

so is there any way to embed a continuously updated google doc or have the PDF automatically open a link when it's loaded with JS or something?

This topic has been closed for replies.
Correct answer Thom Parker

Yes, but it will only work when the PDF is opened in Adobe Acrobat  or Reader.

Add this code to a document script.

 

app.launchURL("The URL.com", true);

 

https://www.pdfscripting.com/public/Document-Level-Scripts.cfm

 

 

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
October 19, 2024

Yes, but it will only work when the PDF is opened in Adobe Acrobat  or Reader.

Add this code to a document script.

 

app.launchURL("The URL.com", true);

 

https://www.pdfscripting.com/public/Document-Level-Scripts.cfm

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
XcissorsAuthor
Participating Frequently
October 19, 2024

i tried that but it doesnt work, this is what the code looks like

Thom Parker
Community Expert
Community Expert
October 20, 2024

Do not put the code inside a function.   Delete the text "function launch()". Then try it. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often