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

how to create a button which opens attachment (power point file attached to the pdf)

New Here ,
Apr 06, 2016 Apr 06, 2016

Copy link to clipboard

Copied

Hi everyone!

The question is like in the title.

How to create a button in Acrobat Pro to open a file which is attached to pdf?

TOPICS
Acrobat SDK and JavaScript

Views

2.6K

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
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 06, 2016 Apr 06, 2016

I moved you question to one of the Acrobat forums, first of all.

If the target file is not a PDF then you need to use a script to do it. The structure of the script would be something like this:

this.exportDataObject({cName: "File name of the attachment.ppt", nLaunch: 2});

Likes

Translate

Translate
Community Expert ,
Apr 06, 2016 Apr 06, 2016

Copy link to clipboard

Copied

I moved you question to one of the Acrobat forums, first of all.

If the target file is not a PDF then you need to use a script to do it. The structure of the script would be something like this:

this.exportDataObject({cName: "File name of the attachment.ppt", nLaunch: 2});

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
community guidelines
New Here ,
Apr 06, 2016 Apr 06, 2016

Copy link to clipboard

Copied

thank you for your answer.

I do not fell like writing scripts... But I need it as a ppt/pptx file as it has to be possibility to reuse the file as a presentation.

This is so strange that Acrobat has no possibility to create such a button- it seems to be so logical... This is crazy! Like a basic thing - button that opens your attachment...

I need Power Point file so I will not convert it into pdf file.

Thanks for your answers!

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
community guidelines
Community Expert ,
Apr 07, 2016 Apr 07, 2016

Copy link to clipboard

Copied

You don't need to write any scripts. I wrote the code for you. You just need to change the file-name in it and you're done. It's really quite simple...

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
community guidelines
New Here ,
Apr 25, 2016 Apr 25, 2016

Copy link to clipboard

Copied

Hi! Thank you for your code.

What occurs - it is an easy way to create a button that opens a power point attachment.

You just edit file in Adobe --> Click the right mouse button in the element that you want to be your opening button --> choose "create link..." and then you just add the file in ppt.

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
community guidelines
Community Expert ,
Apr 25, 2016 Apr 25, 2016

Copy link to clipboard

Copied

That doesn't work if the file is attached to the PDF, though. It only works with independent files that are located on your machine. If you send that PDF to someone else the link won't work for them because they don't have the PPT file...

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
community guidelines
Engaged ,
Apr 07, 2016 Apr 07, 2016

Copy link to clipboard

Copied

Hi Anna -

If you need to keep the PowerPoint presentation as .ppt, then why not just attach it to your PDF document?

Follow these steps:

  1. Open your document, then open the Attachments pane by clicking its icon in the left-hand Navigation panes (it's the paperclip icon)
  2. In the Attachments pane, click Add Attachment on the pane's toolbar. Locate and select your .ppt file.
  3. You'll see your file listed in the pane.
  4. Click the drop-down menu icon, and choose Show Attachments by Default.
  5. Save the document.

To test it, close and reopen the PDF. Since you chose to show the attachments, when the file opens it automatically displays the Attachments pane. This way, your viewers/readers know there's an attachment. If you need a button, you can attach the .ppt to the document, put a button on the page, and then add an action that opens the Attachments pane. Unless you program the button using a script, it won't open directly from the button.

By the way, it isn't so strange that the action would require some code if you look at it from a system perspective. What you're thinking about requires that Acrobat can 'talk' to your computer, and give it instructions. Your task is safe and makes sense, but how many opportunities would there be for malicious and dangerous actions to take place without your knowledge?

donna.

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
community guidelines
New Here ,
Nov 16, 2022 Nov 16, 2022

Copy link to clipboard

Copied

Hi TRY67, you responded recently to a separate post of mine (thank you).  I have my PDF form that has a 2 different PDF attachments, and I used your script: this.exportDataObject({cName: "File name of the attachment.ppt", nLaunch: 2}); to use an action button to open each.  The first button opens the first attachment fine, but the 2nd doesn't open with the script.  I've double checked that the file names in the script are accurate.  Does the script need to change slightly to use another button to open a second attached file, or is this not possible?  I can't think of another reason it wouldn't work

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
community guidelines
Community Expert ,
Nov 16, 2022 Nov 16, 2022

Copy link to clipboard

Copied

Do you mean you want to open both files at the same time? If so, you just need to duplicate that line of code, like this:

 

this.exportDataObject({cName: "File name of the attachment.ppt", nLaunch: 2});

this.exportDataObject({cName: "Second name of the attachment.ppt", nLaunch: 2});

 

If it doesn't work then the file-name is probably incorrect (make sure it's .ppt, for example, and not .pptx).

If you could share the file I would take a closer look at it.

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
community guidelines
New Here ,
Nov 18, 2022 Nov 18, 2022

Copy link to clipboard

Copied

LATEST

No, I wanted the first button to open the first file, and the second button to open the second file.  I checked the file name again, and the file extension needed to be all uppercase, so it's working now.  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
community guidelines
Engaged ,
Apr 06, 2016 Apr 06, 2016

Copy link to clipboard

Copied

Hi -

If you aren't comfortable going the scripting route, use a PDF version of your PowerPoint presentation, which lets you easily control it by a button.

Here's how:

  1. Convert your PowerPoint to PDF.
  2. Open your document, and open the Prepare Form tools. Click Prepare Form and choose the open document. Click Start. Acrobat will evaluate the file and display the Form Editing mode.
  3. Click the Button tool, then click the page to apply the button.
  4. Double-click the placed button icon to open the Button Properties. Click the Action tab.
  5. Leave the Mouse Up trigger, then click the Select Action drop-down and choose Open a File. Click Add.
  6. Locate and select your presentation PDF.
  7. Click Preview to test the file.
  8. Save the document.

I've also made a video of this process, available at AcroFACTS by baker media - YouTube

donna.

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
community guidelines