Skip to content

Instantly share code, notes, and snippets.

@cemerson
Created August 24, 2012 20:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemerson/3455470 to your computer and use it in GitHub Desktop.
Save cemerson/3455470 to your computer and use it in GitHub Desktop.
Other: PDF Expiration Script
var curDate = new Date();
var finalDate = new Date("6/25/2011");
if(finalDate.getTime() < curDate.getTime()){
app.alert("The customer license for this document has expired. Please contact Situational Leadership @ licensing@situational.com regarding customer ID: 123023234 for assistance.");
this.closeDoc(true);
}else{
var ocgs = this.getOCGs();
for(var i=0;i<ocgs.length;i++){
if(ocgs[i].name == "Watermark")
break;
}
ocgs[i].state= false;
}
/* or */
var curDate = new Date();
var finalDate = new Date("6/25/2011");
if(finalDate.getTime() < curDate.getTime()){
showAlert();
}
function showAlert(){
app.alert("The customer license for this document has expired. Please contact Situational Leadership @ licensing@situational.com regarding customer ID: 123023234 for assistance.");
var annoy = setTimeout("showAlert()",3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment