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

Date of Print

New Here ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

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

Views

784

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

Hi

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

Thanks

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

Copy link to clipboard

Copied

At document actions you can only add JavaScript code:

Bild4c.jpg

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

Create a form field and set the value of the 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 ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

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());

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

Thank you

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

Copy link to clipboard

Copied

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.

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

Copy link to clipboard

Copied

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>

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