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

Working with acrobat pro cd. Trying to print a document with current date.

Explorer ,
Jun 30, 2017 Jun 30, 2017

I have a pdf document that does not contain any date.  When I print the document I want the current date to print.  I am looking for instructions to do this.  I've found previous versions that suggest  adding a text field and some javascript using the “document will print” feature under “document processing”, but I can’t find accurate/detailed instructions for it to work with Acrobar pro dc.  I’m not familiar with scripting.

TOPICS
Acrobat SDK and JavaScript , Windows
756
Translate
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 1 Correct answer

Explorer , Jun 30, 2017 Jun 30, 2017

I also went to the text field properties and selected "hidden but printable" and it works perfect.  The date does not appear on my document when viewing but prints current date.

Thank you very much.  I've been scratching my head for 3 days trying to figure this out.

Translate
Community Expert ,
Jun 30, 2017 Jun 30, 2017

Did you create a text field to hold the date? If so, create it and call it Today.

Now go to Tools and search for "document actions". Click on the item found (called "Set Document Actions") and you'll see something like this:

Select the Document Will Print item and click on Edit.

In the window that opens paste this code and then press OK:

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

That's it, pretty much. Save the file and the next time you print it the field will be populated automatically.

Translate
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 ,
Jun 30, 2017 Jun 30, 2017

Thanks for the info.  It didn't work for me.  I inserted a text field and called it TODAY.  Do I need to look at the properties of this text box and perhaps change something there?

Translate
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 ,
Jun 30, 2017 Jun 30, 2017

Then you must use:

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

Translate
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 ,
Jun 30, 2017 Jun 30, 2017

It's still not printing the date.  In the text field - Properties - General tab, what should the "Common properties" be?  Could that make a difference?

Translate
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 ,
Jun 30, 2017 Jun 30, 2017

Where do you see "Common properties"? Your text field needs no special properties, just create it in the forms editor ("Prepare Form").

2017-06-30_10-15-19.png

Just make sure that you select "Format" to "None". Then use the script that was already provided as your "Document Will Print" action. Make sure that the field name is spelled the same way in both the field's properties and the script.

Translate
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 ,
Jun 30, 2017 Jun 30, 2017
LATEST

I also went to the text field properties and selected "hidden but printable" and it works perfect.  The date does not appear on my document when viewing but prints current date.

Thank you very much.  I've been scratching my head for 3 days trying to figure this out.

Translate
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