• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adding Automatic Date to PDF that updates upon opening.

New Here ,
Dec 10, 2019 Dec 10, 2019

Copy link to clipboard

Copied

Hi, I need help with something. 

I am creating forms that need to be filled out. I am definitely not an expert and neither are the people that use my pdf's. Now I created all the files and placed text fields where needed and everything works as a charm. What is missing is: I need a small area called " Date: " To Autofill the correct date when a used opens the PDF. But only the user who fills it. Not the one opening it to read and respond. 

 

I managed to do it, but the date doesn’t update. It always gives me the original date I used.

 

Second problem. I live in Canada, and more specifically in Quebec. They have some computers who will write the date as: dd/mm/yy and others who use mm/dd/yy. And if you chose the wrong one for example yesterday I used 09/12/2019. And it wrote Sep, 12 2019. But on the other computer I wrote for the same file, 9 Dec 2019. (We are in December as I write this) Now I can’t control the way the computers are set some people French will use dd/mm/yy. The English operating systems use the mm/dd/yy.

 

What can I do?  

TOPICS
Create PDFs , General troubleshooting , How to , PDF forms , Standards and accessibility

Views

53.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 10, 2019 Dec 10, 2019

Copy link to clipboard

Copied

Hi,

 

In edit mode, right-click on the date field, select Properties, and then the "Format" tab.

 

Then select from the pulldown menu that is right below the tab select "Date" and then "Custom".

 

In the blank provided below that selection type in the format that you want the date to be displayed like.

 

Click ok and you should be good to go.

 

Users won't have to type in a date anymore. A datepicker will provide the users of the form to select a date from a calendar pop up; the date will be displayed with the formatting that you've selected earlier.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 10, 2019 Dec 10, 2019

Copy link to clipboard

Copied

Since you want the date to populate automatically, after adding the form field, in Text Field Properties in the General tab, turn on Read Only so that the user cannot change the date.

Next you'll need to create a document level script that is executed when the document is opened. If you don't see the JavaScript tool, click on More Tools in the list on the right and add it to your list of tools. Click the JavaScript tool. Then at the top of the screen, click Document JavaScripts. Give the script an appropriate name and click Add. Delete any text in the window and add this script:

var f = this.getField("Today");f.value = util.printd("mm/dd/yyyy", new Date());

The text in quotes should be the name of your form field, and it is case sensitive. In this example, the date field is named Today.

Click OK and Close.

To test that the form field is working correctly, Save the PDF, close it and then re-opoen it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2019 Dec 10, 2019

Copy link to clipboard

Copied

[Email address removed]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 10, 2020 Sep 10, 2020

Copy link to clipboard

Copied

Thank you for this solution, it worked great. However, I want the date field to not just be "Today" but it needs to change whenver someone MODIFIES the PDF. If someone simply opens it and looks, I do not want the date to change. But if someone types on the form itself and fills in information, that is when the date at the top should change. How can I do that?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 04, 2024 Jul 04, 2024

Copy link to clipboard

Copied

LATEST

Barbara, you solved my long time problem. Thanks a lot!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2019 Dec 10, 2019

Copy link to clipboard

Copied

Como  ago para kel m devuelvan mi exceso de pago en infonavit del  a nombre de Esteban Hernandez Rivera

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 11, 2019 Dec 11, 2019

Copy link to clipboard

Copied

Lets look at each problem seperately.

What scripts did you use and where did you place the code for placing the auto entry date?

 

See Example Acrobat JavaScripts item 3. Run JavaScript on Document Open. It is more complex then you might need, but it will populate the date when the PDF is opened. Beaware that it will repopulate the date each time the PDF is opened. Additional code will be needed to prevent cheangint the date one it file has been opened and saved.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 11, 2019 Dec 11, 2019

Copy link to clipboard

Copied

See Example Acrobat JavaScripts for 2 examples of autopopulating populating a field with a date string. You want the item 3. Insert Today’s Date into Form Field. You will have to create a document level script action.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines