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

How do I close down a pdf when seen in a browser?

bikeryamaha
Registered: May 9 2007
Posts: 28

In order to close down a pdf-file, I have been using the script:
this.closeDoc(true). However, I now realize that this will not operate if the file is seen 'external'. I also tried to execute a menuitem "Close". This method doesn't work either.
How should I do?

Henrik :)

My Product Information:
Acrobat Pro 7.0.9, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
By external I assume that you mean the PDF is being displayed in a browser? Unfortunately Adobe has amped up the security with every version and disallowed things that used to work, like hitting the "Close" menu item.

There may not be a way to make this work. But there are some things you can try. For example, if the PDF is being displayed by a line in an HTML page, then force it to load throught the Object tag.

This gives you the ability to open and close the the pdf from JavaScript in the HTML. You can find more info on this in the Acrobat Interapplicaion Communication reference.

http://www.adobe.com/devnet/acrobat/

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