• Global community
    • Language:
      • Deutsch
      • English
      • EspaƱol
      • FranƧais
      • PortuguĆŖs
  • ę—„ęœ¬čŖžć‚³ćƒŸćƒ„ćƒ‹ćƒ†ć‚£
    Dedicated community for Japanese speakers
  • ķ•œźµ­ ģ»¤ė®¤ė‹ˆķ‹°
    Dedicated community for Korean speakers
Exit
0

Current Date and Time

Community Beginner ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

I have been using 

event.value = util.printd('m/d/yyyy h:MM tt', new Date());

to display the date and time printed on my documents. It used to work displaying the current date and time but now it does not update but prints the date and time created.

TOPICS
PDF forms , Print and prepress

Views

1.2K

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

correct answers 2 Correct answers

Community Expert , Oct 29, 2020 Oct 29, 2020

Printing the file will not trigger this code. You should move it to the Will Print event of the document, or add a call there to the calculateNow method.

Votes

Translate

Translate
Community Beginner , Nov 16, 2020 Nov 16, 2020

Thnak you, I used the document "Will Print" event in JavaScript as shown by Try67 and my issue has been resolved. Thaks all.

Votes

Translate

Translate
Community Expert ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

Where does you use the script?

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 Beginner ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

In scanned document  - prepare forms, image field, date and time. Formula added to the calculate field.

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 ,
Oct 29, 2020 Oct 29, 2020

Copy link to clipboard

Copied

Printing the file will not trigger this code. You should move it to the Will Print event of the document, or add a call there to the calculateNow method.

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 Beginner ,
Nov 06, 2020 Nov 06, 2020

Copy link to clipboard

Copied

I am unable to locate the "Will Print" event of the document. However, using my previous approach I have inconsistent results. It works sometimes but not always.

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 ,
Nov 06, 2020 Nov 06, 2020

Copy link to clipboard

Copied

Does you use Acrobat Standard or Pro.

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 ,
Nov 06, 2020 Nov 06, 2020

Copy link to clipboard

Copied

I think Try67 is referring to the document actions .

 

You need to go to tools and select the "JavaScript" tool to get to the document eventss.

 

willprint.png

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 Beginner ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

I am using Adobe Acrobat Pro DC. What properties of a document would interfere with the formula?

event.value = util.printd('m/d/yyyy h:MM tt', new Date());

It works with some of my scanned documents but not with others.

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 ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Where did you place the code?

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 Beginner ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Prepare Form, Date Field, Properties, Calculate, Custom calculate script.

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 ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Then it should work fine, but it will not update just by opening the file...

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 Beginner ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

In some documents it updates automatically when opened, with others it always print the date and time the script was entered and never updates unless it is re-entered. How can I get it to update automatically?

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 ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

Use the document will print event.

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 Beginner ,
Nov 16, 2020 Nov 16, 2020

Copy link to clipboard

Copied

LATEST

Thnak you, I used the document "Will Print" event in JavaScript as shown by Try67 and my issue has been resolved. Thaks all.

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