These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How to open attached pdf file?

stipe.pavicic
Registered: Apr 11 2007
Posts: 9

How to open attached PDF with JS command? I've tried with app.openDoc("attachment.pdf", this);
and this works , but if I copy the pdf file with attachment to another folder on my computer or if I try to run it on another computer it won't work...

I am a Consultant at HSM informatika, Croatia. I am an Adobe Certified Expert.

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The app.openDoc() function only opens external files, not attached files. There is a special function for this.

this.openDataObject("attachName");

Unfortunately this function opens the attached PDF as a "Hidden" doc. If you want the user to be able to press a button that opens the attached file you should use the "Go to page view" action.

When you set this action on a button, bookmark, or other PDF control, it will ask you to set the destination link. At this point, open the attached file and then press the "Set Link" button. Now you have a control that will open the attached file. If it's a book mark, you can use it in script.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script