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

Date of Print

New Here ,
Mar 31, 2017 Mar 31, 2017

Hello

I have tried googling with no luck and really need some help.

I need to add 'Date printed dd/mm/yy' to my PDF docs. I have tried to enter a script I have found on line within the calculation of a 'form' but all this does is create the current date and not the actual date the doc was printed. Should I be adding something in to the actions/javascript instead? I need to text to show on the document too and not just hidden until printed.

Thanks in advance

TOPICS
Acrobat SDK and JavaScript , Windows
827
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 ,
Mar 31, 2017 Mar 31, 2017

You must add the code to "Document Will Print" in the document actions.

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
New Here ,
Mar 31, 2017 Mar 31, 2017

Hi

Thanks, do I add this in the calculation section of the form or do I add this in the javascript?7

Thanks

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 ,
Mar 31, 2017 Mar 31, 2017

At document actions you can only add JavaScript code:

Bild4c.jpg

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
New Here ,
Mar 31, 2017 Mar 31, 2017

Brill thank you, I have now found it. Would you know the best script to write. I literally just want 'date of print dd/mm/yy' but those I have found on the internet are not working for me. Also would this create a form field? I ideally need it to so I can move it to a particular part of the document.

Thanks

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 ,
Mar 31, 2017 Mar 31, 2017

Create a form field and set the value of the field.

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 ,
Mar 31, 2017 Mar 31, 2017

It's better to create the field in advance and place it at the location where you want the text to appear. Set its display property to "Printable, but hidden". Then enter this code into the Will Print event you found (let's say the field's name is "PrintDate"):

this.getField("PrintDate").value = "Date of print: " + util.printd("dd/mm/yy", 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
New Here ,
Mar 31, 2017 Mar 31, 2017

thank you this is very helpful. I shall try now. Is there a way of making the date visible within the form field and not just when printed? I'm guessing I would need to add something to the script?

Thanks

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
New Here ,
Mar 31, 2017 Mar 31, 2017

Sorry.. also.. I have tried to print and the form box is blank. Should I be adding something within the form also?

Thank you

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
New Here ,
Mar 31, 2017 Mar 31, 2017

Sorry.. me again. I've had a play around and got used to the form/java script and your suggestions have worked. Thank you so much for you help you are amazing.

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 ,
Mar 31, 2017 Mar 31, 2017
LATEST

If you want to make it visible the whole time just set the display property

of the field to Visible.

On Fri, Mar 31, 2017 at 1:52 PM, valeriew68304081 <forums_noreply@adobe.com>

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