Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Community Beginner ,
Oct 19, 2024 Oct 19, 2024

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?

TOPICS
JavaScript , PDF
716
Translate
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
1 ACCEPTED SOLUTION
Community Expert ,
Oct 19, 2024 Oct 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

View solution in original post

Translate
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
Community Expert ,
Oct 19, 2024 Oct 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 PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
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
Community Beginner ,
Oct 19, 2024 Oct 19, 2024

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

Acrobat_GDAbyzFDqx.png

Translate
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
Community Expert ,
Oct 19, 2024 Oct 19, 2024

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

 

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

Translate
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
Community Beginner ,
Oct 19, 2024 Oct 19, 2024
LATEST

Thanks that worked, i also had to add https:// bc it defaults to file://

Translate
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