Previous | Next | (P-PDF) JavaScript
Topic: Re: close document impossible? (Via Email)
Conf: (P-PDF) JavaScript, Msg: 152018
From: cdahl
Date: 7/12/2006 10:10 PM
Hi Laurie,
Yes you can, the trick is with the object referencing. What you want to
do is create a JavaScript variable (in example below this is
'targetDoc') to store the Doc object of the PDF document you're wanting
to open in, then use the this.closeDoc() to close the current PDF.
Here's some code, hopefully you can follow...
--------------------
// the PDF you want to open
var targetDoc = app.openDoc("/c/temp/targetpdf.pdf");
// now close the current PDF that is open
this.closeDoc();
--------------------
You would just put that JavaScript under the Mouse Up event of whatever
annotation (link, form field, etc) you're getting the user to click.
- Chris.
___________________________________
Chris Dahl
ARTS PDF / Nitro PDF
http://www.artspdf.com/
-----------------------------------
3x FASTER THAN ACROBAT, 1/3 THE PRICE.
Winner of PC User magazine's "Top Buy" award.
Get Nitro PDF by ARTS PDF now: www.nitropdf.com