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

Open a file in another application from within a PDF

New Here ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

Hello,

Apologies if this has been asked before, but I have searched with no luck.

I want to assign a button in my PDF to open up an .ai file in Illustrator. Now, I know I can use the Open File action, navigate within Finder to find my file to link to. That works fine.

But I need a bit more flexibility than that, as I want to be able to manually type in a file path (reason, my PDF will be shared with three offices, each of which will have their own file paths. I don't want to have to travel to the other office just to relink a new file, should something change. If I can type in manually I can set the file path remotely)

So I thought to use app.openDoc....

app.openDoc("/Users/produser/Desktop/testfile.ai")

However, all that does is open up the file in a new window within Acrobat.

Is there a way to tell Acrobat that the target application for the file is Illustrator, not Acrobat?

Thanks

JTH

TOPICS
Acrobat SDK and JavaScript

Views

372

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 ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

No, that would be a huge security risk.

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
New Here ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

OK, granted I clearly need to learn more about this, but please explain why.

How is what i am trying to do different to using the Open File action?

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 ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

A malicious code could then execute any file, including executables, on the computer. It could use trial-and-error methods to locate sensitive files, find vulnerabilities in the system, etc. The Open File command can only open specific file types and can't perform "tests". It must know the full file path in advance.

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
New Here ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

OK, understood. Thank you.

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 ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

Well actually, Acrobat can tell the OS to open an attachment in whatever program matches the file extension.

Here's the JavaScript reference entry (note the nLaunch parameter, and the security restrictions):

Acrobat DC SDK Documentation

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 ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

This can only be used for files that are actually attached to the PDF file

itself, though.

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 ,
Dec 18, 2018 Dec 18, 2018

Copy link to clipboard

Copied

LATEST

True, and files can be imported manually or through a privileged script in Acrobat Pro, or with a 3rd party viewer/pdf tool. So it's a viable strategy. There are just some requirements.

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