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

Open excel file with a click of a button in PDF

New Here ,
Jan 13, 2025 Jan 13, 2025

Copy link to clipboard

Copied

Hi, I have created a button, to trigger it to run a javascript code, to launch excel file.

My java code as below:

 

var filePath = "file:///C:/Path/To/Your/File.xlsx"; 
app.launchURL(filePath, true);

 

The problem is, it wont open the excel file.

Is my code is correct? Anything that I miss out?

 

Thanks in advance

TOPICS
How to , JavaScript , PDF , PDF forms

Views

57

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
Community Expert ,
Jan 13, 2025 Jan 13, 2025

Copy link to clipboard

Copied

No, it won't work. Did you look in the Console Window (Ctrl-J) to see the reported error?

 

Acrobat is sandboxed. Meaning that scripts in a PDF operate only in the PDF/Acrobat enviroment, NO touching things on the users local system, unless specific security measures are taken.  And even then, there are limitations in the API. 

Read this:

https://www.pdfscripting.com/public/Trust-and-Privilege-in-Acrobat-Scripts.cfm

 

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

Votes

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
Community Expert ,
Jan 13, 2025 Jan 13, 2025

Copy link to clipboard

Copied

LATEST

To be able to do it you must attach the Excel file to the PDF, then use a script to open it.

Votes

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