These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Form usage time stamp

JPM
Registered: Sep 19 2007
Posts: 14

Greetings -
 
My user would like me to add some sort of time stamp or identifier that would allow them to know who last filled out a PDF Form (kind of like a historical record of who used the form) The end user will be filling this PDF Form out in Reader. Is this possible?
 
Thanks.

My Product Information:
Acrobat Pro 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
It sounds like you've got a closed environment so yes, in this context you can set a time stamp and identity from Reader. There are two ways to go about it.

First, all you need to do is add a field to the form that will hold this data and enable the form for Reader Save Rights, which you'll find on the Advanced menu in Acrobat 8.

The next part gets a little tricky. You can fill in the form field from an Automation script, or a script on document. The automation script is the easiest. The script lives in one of the Acrobat JavaScript folders and on Acrobat startup is places either a toolbar button or menu item in Acrobat. The Script executed by the toolbar button or menu item would fill in the form field with the current date and identity of the user. This has to be done from a privileged context because the users identity is protected data. So you'll need a privileged function to do the real work. Look at this article on folder level scripts:

[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/folder_level_scripts/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/folder_level_scripts/[/url]

Also look in the Acrobat JavaScript Reference for the "identity" object and the "app.trustedFunction()" function. Also read this artical on using Dates in JavaScript. In fact, the artical contains a sample with a feature very similar to what you are looking for.

[url=http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/]http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/date_time_part1/[/url]

The second method is to place the script that fills in the field into the PDF's "WillSave" event. This will work fine for the date, but the only way for it to work with the identity is to give the PDF Privilege. There is only one way to do this and that's to certify the PDF. If a certified document is opened on a user's system that contians the certifying digital signature, and nothing has broken the certification, the document scripts are given privilege.

So your choices are to copy a JS file to every user's system, or to copy a digital signature to every user's system. Or to not include the user's identity in the saved info.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script