JavaScript for Acrobat: document.close() does not work

  • Follow


I'd like the document to close after a certain expiration date. So, I
use the following JavaScript on the properties of the first page:

var d = new Date();
  var d1 = util.scand("mm/dd/yy", "1/1/05");
  if((d1.valueOf() - d.valueOf()) < 0){
     app.alert("Document expired! Please consult www.ozshy.com");
     document.close();
  }

The alert works fine (as 2005 as passed), but the document does NOT
close. Any suggestion how to modify this JavaScript so that the
document will close? (I use Standard Acrobat 6).

0
Reply ozshymail (11) 12/4/2006 9:49:51 AM

"Oz Shy" <ozshymail@gmail.com> wrote:

>I'd like the document to close after a certain expiration date. So, I
>use the following JavaScript on the properties of the first page

Doesn't seem much point as the user can turn off JavaScript in
preferences.
----------------------------------------
Aandi Inston  
Please support usenet! Post replies and follow-ups, don't e-mail them.

-1
Reply quite 12/4/2006 11:52:01 AM


Indeed, you are correct. I simply don't have any better solution (in
addition to encryption and passwords).
Still, I think that it would work for those who are not aware of the
possibility of turning off the JavaScript.  Oz.

On Dec 4, 12:52 pm, q...@dial.pipex.con (Aandi Inston) wrote:
> "Oz Shy" <ozshym...@gmail.com> wrote:
> >I'd like the document to close after a certain expiration date. So, I
> >use the following JavaScript on the properties of the first pageDoesn't seem much point as the user can turn off JavaScript in
> preferences.
> ----------------------------------------
> Aandi Inston
> Please support usenet! Post replies and follow-ups, don't e-mail them.

0
Reply Oz 12/4/2006 12:55:38 PM

this.closeDoc(true)

HTH, Reinhard

0
Reply ReFOB 12/4/2006 7:15:40 PM

Thanks Reinhard, that's the command that I've been looking for. Oz

On Dec 4, 8:15 pm, "ReFOB" <R...@web.de> wrote:
> this.closeDoc(true)
> 
> HTH, Reinhard

0
Reply Oz 12/5/2006 6:55:36 AM

4 Replies
1520 Views

(page loaded in 0.091 seconds)

Similiar Articles:













7/22/2012 1:55:11 PM


Reply: