Skip to main content
June 28, 2016
Question

Obsolete date & time when printed. How can I set this up?

  • June 28, 2016
  • 2 replies
  • 729 views

I work at an academic facility which is regulated by the FDA. We have standard operating procedures (SOPs) in PDF format which we need to controlled, meaning, if a PDF of an SOP is printed, I need to automatically stamp it with a "Print date/time" as well as an "Obsolete as of: date/time" which is 7 days after printing. The key to this stamp is that it is automatically updated with the requisite dates and times. I attempted to use a custom stamp, however, it wouldn't automatically update the dates/times.

This topic has been closed for replies.

2 replies

Inspiring
June 28, 2016

Tis can be something that you implement with form fields and some JavaScript. There is a Document Will Print event where you can place the code. The script could be something like:

// Document Will Print scipt

// Get the current date/time

var oCurrent_Date = new Date();

// Update the date printed field

getField("DATE_PRINTED").value = "Printed: " + util.printd("yyyy-mm-dd HH:MM:ss", oCurrent_Date);

// Add 7 days to current date

oObsolete_Date = oCurrent_Date.setDate(oCurrent_Date.getDate() + 7);

// Update the Obsolete date field

getField("OBSOLETE_DATE").value = "Obsolete as of: " + util.printd("yyyy-mm-dd HH:MM:ss", oObsolete_Date);

Replace the field names in the getField statements with the actual names of the fields on your form.

July 1, 2016

Thanks for the suggestion. Unfortunately, I haven't been able to figure out how to implement your suggestions. I'm not sure how to get the JavaScript into the form. Also, I'm using Acrobat Pro XI, and it has the Form Central, which I'm not certain how it works. Can you provide any further instructions on how to accomplish this?

Bernd Alheit
Community Expert
Community Expert
June 28, 2016

Use form fields for this.