Beenden
  • Globale Community
    • Sprache:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

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

Community-Einsteiger ,
Oct 18, 2012 Oct 18, 2012

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.

THEMEN
Digitale Sicherheitssignaturen und elektronische Signaturen
67.0K
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
1 AKZEPTIERTE LÖSUNG
Adobe-Mitarbeiter ,
Oct 18, 2012 Oct 18, 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

Lösung in ursprünglichem Beitrag anzeigen

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Adobe-Mitarbeiter ,
Oct 18, 2012 Oct 18, 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

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Dec 10, 2015 Dec 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?

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Fürsprecher ,
Dec 14, 2015 Dec 14, 2015
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Mar 12, 2016 Mar 12, 2016

Go into the properties of the field that you have the date populating in. Click the "Format" tab and select the date format category. After that you will scroll all the way down to the bottom of the box with the date formats and select "Custom". It will populate a field just below it that will allow you to write the date format as you see fit.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Jul 18, 2018 Jul 18, 2018

I was able to get the date to populate correctly! Thank you @Steven.Madwinfor the helpful information. One more thing I would like to ask of you. Now that I have the date auto populating on the form when digitally signed, how do I make the form read only at the same time it is digitally signed? I am not able to select "Mark as read-only" and "This script executes when field is signed" buttons at the same time. Is it even possible?

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Adobe-Mitarbeiter ,
Aug 15, 2018 Aug 15, 2018

Hi rsimpson258,

Since you are digitally signing the file, as long as it's the last signature field being signed you have the option to lock the document, which effectively makes all of the form controls read-only. Select this checkbox circled below and the file will end up being read-only.

Sign Dialog.png

Steve

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Oct 07, 2019 Oct 07, 2019
Thank you Steven for the assistance. I have completed the date field, but also want to make fields read only. However, I have 3 different signature fields on my form and would only like to make certain fields read only once the signatures and signed in sequence. Thank you for your assistance.
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
Oct 07, 2019 Oct 07, 2019
Hi, I see this is an old thread. Adding to the suggestions above, I used this script in "Actions" --->>> Run a javascript instead. It worked for me : this.getField("yourotherTextField).value = util.printd ("yyyymmdd", new Date()); and then in the textfield that you want this date from signing time use Custom Calculation Script adding this line: var s = this.getField("SignatureField").value; if (s=="") event.value = ""; To only make certain fields read-only , right-click on the signature field---> Properties---> Digital Signature Properties---> click on the "Signed" tab. Then slect the radio button that is labeled "Mark as read-only:" . The pulldown menu that appears greyed out next to it wil become active and you will be able to choose "just these fields". An itemized list will open will all the fields in your document than you can tick or untick to select specifically which ones you want as read-only after a digital signature is applied.
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Oct 17, 2019 Oct 17, 2019
Hi, I am facing same issue as need to populate date field with current date automatically when user digitally signed...I am trying to follow the above steps but i don't see any Digital Signature Properties option when i right click on the signature field in Adobe Live Cycle design, Kindly help on this as its bit urgent
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
Oct 17, 2019 Oct 17, 2019
The script is not for LiveCycle Designer forms.
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
Oct 19, 2019 Oct 19, 2019
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Jul 13, 2022 Jul 13, 2022

I know this is an old thread but I know nothing about javascript and could use some assistance. The code works just as needed for me except for the date format, so how do I change it so the date is formatted as MM/DD/YYYY?

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Jul 13, 2022 Jul 13, 2022

dang it, never mind .... just switch the date and month there.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Neu hier ,
Apr 25, 2020 Apr 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?

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
Apr 25, 2020 Apr 25, 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.

 

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
May 02, 2020 May 02, 2020

+++ EDITED REPLY (some corrections made)

 

As a matter of fact yes. If you read the referenced pages  that I posted earlier you can get the Distinguished Name from the digital certificate used in the signature field (there are more code examples in Page 334).

 

To do so declare a variable using the "signatureInfo()" to call the signatureInfo Object and also decalre a variable with "sigInfo" to pull from the signatureInfo object the Distinguished Name label that was used in the digital certificate of  the digital ID.

 

In your signature field, select Properties from the context menu and go to the "Sign" tab. Then tick the radio button "This script executes when field is signed" and place the following script there as shown in the slide below:

 

 

 

 

 

var f = this.getField("Signature");
var sigInfo = f.signatureInfo();
var cert = sigInfo.certificates[0];
this.getField("Text1").value =  cert.subjectDN.cn;

 

 

 

 

 

 

distinguishname.png

 

 

 

The script will copy the Distinguished Name label  to the field "Text1" in my example above.

 

 

 

 

 

 

 

 

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Teilnehmer ,
Feb 19, 2024 Feb 19, 2024

This works amazing.  However, it displays the signature number after.  How do you make it so that it only displays the signature name?

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
Feb 20, 2024 Feb 20, 2024
AKTUELL

Do you mind sharing a screenshot?

 

I am not sure if you're referring to a government issued digital  certificate embedded in a smart card.

 

In which case, I would assume that the number that you're referring to is the EDIPI that is appended at the end sperated by periods, correct?

 

 

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
May 02, 2020 May 02, 2020
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
Apr 25, 2020 Apr 25, 2020

Just a reminder: a digital signature is necessarily dated.

😉


Acrobate du PDF, InDesigner et Photoshopographe
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines