Copy link to clipboard
Copied
I'm responsible fo issuing controlled documents and want to have an "Expired" watermark appear on the document after a specific date. Is this possible? If so, how can it be done. Thanks.
Copy link to clipboard
Copied
Doing it with an actual watermark is tricky. A better solution is to create a layer or field in advance and then show/hide it when the file is opened based on the current date, using a script.
Copy link to clipboard
Copied
Thanks try67. I'll try that... after learning how to do it. Any suggestions on how to create such a script or add it to the pdf, would be greatly appreciated!
Copy link to clipboard
Copied
Let's say you use a field for this, called "Expired", and that the cut-off date to show it is June 1st 2021.
Create the field with the expiration text as its default value and set it as read-only.
Then enter the following script under Tools - JavaScript - Document JavaScripts (not inside a function, though!):
var now = new Date();
var cutOffDate = util.scand("mm/dd/yyyy", "06/01/2021");
this.getField("Expired").display = (now.getTime()>cutOffDate.getTime()) ? display.visible : display.hidden;
Copy link to clipboard
Copied
It worked! Took me a bit to figure out, but it worked. Thanks!