Open a file in another application from within a PDF

New Here ,
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

133

Likes

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

Open a file in another application from within a PDF

New Here ,
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

134

Likes

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
Dec 18, 2018 0
Most Valuable Participant ,
Dec 18, 2018

Copy link to clipboard

Copied

No, that would be a huge security risk.

Likes

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
Reply
Loading...
Dec 18, 2018 0
New Here ,
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?

Likes

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
Reply
Loading...
Dec 18, 2018 0
Most Valuable Participant ,
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.

Likes

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
Reply
Loading...
Dec 18, 2018 0
New Here ,
Dec 18, 2018

Copy link to clipboard

Copied

OK, understood. Thank you.

Likes

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
Reply
Loading...
Dec 18, 2018 0
Adobe Community Professional ,
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

Likes

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
Reply
Loading...
Dec 18, 2018 1
Most Valuable Participant ,
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.

Likes

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
Reply
Loading...
Dec 18, 2018 1
Adobe Community Professional ,
Dec 18, 2018

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Dec 18, 2018 1