Skip to main content
Participant
October 18, 2012
Answered

Can Acrobat auto populate a date field upon digital signature of a form?

  • October 18, 2012
  • 3 replies
  • 67918 views

We use several fillable forms with digital ID signature fields.  A business rule requires a date field next to the signature field.  Is it possible to define the date field to auto populate once the user signs the form?  I can't check this in Acrobat since I only have the reader.

This topic has been closed for replies.
Correct answer Steven_Madwin

Hi,

The short answer is yes, but of course you'll need to get Acrobat to edit the PDF file.

Generically, here is what  you are looking to do:

  1. Open the Digital Signature Properties dialog
  2. Select the Signed tab
  3. Select the This script executes when the field is signed radio button
  4. Click the Edit button
  5. Add the code snippet below to the JavaScript editor
  6. Click the OK button on the JavaScript editor
  7. Click the Close button on the Digital Signature Properties dialog

// JavaScript code to add the date at signing time

    var currentTime = new Date()

    var month = currentTime.getMonth() + 1

    var day = currentTime.getDate()

    var year = currentTime.getFullYear()

    var signingTime = day +"/"+month+"/"+year  //Modify into your preferred format

    var f = this.getField("Text1");  //Modify the field name as necessary

    f.value = signingTime;

Good luck,

Steve

3 replies

JR Boulay
Community Expert
Community Expert
April 25, 2020

Just a reminder: a digital signature is necessarily dated.

😉

Acrobate du PDF, InDesigner et Photoshopographe
Participant
April 25, 2020

I'm wondering if there's a way to do a similar thing but with the signers name? Is there script that will pull the individuals name from the signature and auto populate it into a designated text box?

ls_rbls
Community Expert
Community Expert
April 26, 2020

Yes you can but is complicated.

 

I asked this question before in an older thread.

 

In the case of government forms,  the individual who signs have to apply a digital signature to many fields and also type in printed name and select date.

 

This is time consuming so it is possible to get signature and date  information.

 

This is vaguely covered in the Adobe Acrobat DC  SDK - Developing Acrobat Applications Using Javascript, "Getting Signature Information from another user", pages 163-165.

 

You have to do some serious readeing and figure out how the SignatureInfo object properties of the security handler works.

 

You'll need also to read about SeedValue  and the SecurityHandler object found in the Acrobat JavaScript Scripting Reference, "Field Methods", pages 270-275.

 

Steven_Madwin
Adobe Employee
Steven_MadwinCorrect answer
Adobe Employee
October 19, 2012

Hi,

The short answer is yes, but of course you'll need to get Acrobat to edit the PDF file.

Generically, here is what  you are looking to do:

  1. Open the Digital Signature Properties dialog
  2. Select the Signed tab
  3. Select the This script executes when the field is signed radio button
  4. Click the Edit button
  5. Add the code snippet below to the JavaScript editor
  6. Click the OK button on the JavaScript editor
  7. Click the Close button on the Digital Signature Properties dialog

// JavaScript code to add the date at signing time

    var currentTime = new Date()

    var month = currentTime.getMonth() + 1

    var day = currentTime.getDate()

    var year = currentTime.getFullYear()

    var signingTime = day +"/"+month+"/"+year  //Modify into your preferred format

    var f = this.getField("Text1");  //Modify the field name as necessary

    f.value = signingTime;

Good luck,

Steve

Participant
December 10, 2015

I've got the JavaScript to work but I don't know enough about it to fix the issue I'm encountering with the month and day being switch. For example, if i sign the form today, the date populated is showing October 12, 2015.

How would I fix this?

Inspiring
December 15, 2015