Skip to main content
fjacquette
Participating Frequently
January 6, 2018
Answered

Is there any internal property that indicates when a form field was last modified?

  • January 6, 2018
  • 1 reply
  • 3555 views

Greetings,

I am working with a client on a fairly long form for manufacturing process validation.  It's 115 pages and has nearly 4,000 user editable fields.

They want to be able to verify when each field has been entered by users.  While we can certainly use signatures to confirm that fields were filled in before the signature, the order in which fields are completed and the time between field completion matters to them from a process management standpoint.

My (perhaps simple) question is this:  does Acrobat track the time when a field's content was last updated?  If it does, does it also track the user name? Since it knows what's been changed since a signature was applied I'm hopeful that it's tracking that information internally and I can access it programmatically.

If not, has anyone ever used Javascript on the fields to try and accomplish the same thing?

Thanks!

This topic has been closed for replies.
Correct answer Thom Parker

You don't need one field for each field's timestamp. Just one field for all of them. You also don't have to manually add any code to the fields. This can all be done with a script that places the necessary code into the fields.

To detect when a field is changed, the best event is the Validate event, which is only called when a field's value is changed.  If you wanted to detect when a field is touched, meaning the user typed into a field, as opposed to actually changing the field, then you'd use the Keystroke event. The Blur event is fired when a field looses focus. This event could be fired when the user is just tabbing through the fields and does not intend to change it. All fields have these events, even if you can't enter code in them from the Acrobat UI.  But a script can put code in the these events for all fields.

As for digital signatures and the change info, whenever you save s PDF, Acrobat appends the changes to the end of the file.  So there is a record of all modifications going back to the first time the file was cleanly saved.  The modification time for the individual fields is not saved, but rather the last time the document is saved, is saved.  I'm not sure of the exact details, but I'm sure you can find out all about it in the PDF specification document and Acrobat's SDK guides. As Leonard said earlier, you'd need to write a plug-in or some other program much more sophisticated than Acrobat JavaScript to acquire this information. The Python SDK may be sufficient if it can drill down to the COS level. Be warned, it can be quite complex.

That said, you can certify a PDF with a digital signature, and allow form fields to be filled. I have not experimented with this process much, but the JavaScript model does provide a way to got all the changes since a document has been signed. However, I don't know if level of detail would match what you are looking for, or if form fields would even be reported if the certification is set to allow them.

1 reply

Thom Parker
Community Expert
Community Expert
January 6, 2018

No, but you could very easily write a script to capture this data. You could store it as JSON in a hidden text field.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
fjacquette
Participating Frequently
January 7, 2018

Thanks for the reply.  I was hoping to avoid the creation of 4,000 invisible text fields and the addition of the associated JavaScript to the visible fields, but c'est la vie.

Just out of curiosity, how does Acrobat know which fields have been changed since the last time a digital signature was applied?

So if I'm adding an action to a field that executes JavaScript, I want it to execute when the user either hits Enter or the field loses focus.  Is that equivalent to the Mouse Exit event?

Thanks,

[[ Frank ]]

Thom Parker
Community Expert
Community Expert
January 16, 2018

Thanks for all the help.  I have it up and running as described - one big text field holding a JSON version of key/value pairs with field name/last modified time.  I haven't tested it when that field gets large yet, but I am optimistic that it will perform reasonably well.


You can improve performance by holding the data in a document variable until the form is closed, then convert to JSON and save in the field when the doc closes. Then on document open, converting the JSON to the doc variable.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often