These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Inserting a hidden "Date Printed" field...

kapoli
Registered: May 6 2011
Posts: 6
Answered

Acrobat novice here. Slightly familiar with JS, but stumped on how to accomplish what I'm trying to do. Seems like it should be relatively easy, so I'm hopeful that someone can help walk me through it...
  
What do I need to do in order to get the date on which a PDF is printed to appear when the document is printed (but not appear on screen)?
 
I'm not inserting this on a form, just on a regular document. I need people to be able to keep track of when they printed that hard copy of the document.
 
I was going to insert a form field in the footer and use the JS I've seen in other posts related to this topic, but as soon as I do that, I've turned my non-form into a form without the viewer understanding/realizing why they're suddenly viewing a form. If there's a way to add the form field without having the purple "form" message bar appear at the top of a non-form when someone opens the PDF, that would be great.
 
I've seen some various tutorials online that have existing PDFs inserted as watermarks, imported as layers, used as stamps... I've seen a variety of javascripts that all sound like they'd do what I need done... I just can't figure out the combination of how to put this all together! :)
 
Can someone give me some advice on what my options are and how to go about successfully doing this?
 
Thanks very much in advance for any help. I really appreciate it!

My Product Information:
Acrobat Pro 10.0.2, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
You could add a read only button for the text.

Reader can not do watermarks.

With a button field named "Button1" the following 'Will Print" action will work:

this.getField('Button1').buttonSetCaption(util.printd("mmm d, yyyy h:MM tt", oDate));

George Kaiser

kapoli
Registered: May 6 2011
Posts: 6
Hi George,

Forgive me, but I'm not sure I understand your suggestion. Will making my form field "read only" eliminate the purple "please fill out the following form" message at the top?


These are the things I have tried based on tutorials I've found which claimed they'd achieve this effect:

1) Watermark - I created a form in Acrobat with a text field ("Today") and a JS that calculated the current date to insert into that field. I saved that form as "dateprinted.pdf".

Then, in the document where I needed the date to show up, I inserted a watermark and chose the "dateprinted.pdf" as the watermark. I placed it where I wanted it, and everything looked fine initially. However, the date never changed. It was always the date I originally created/saved the two PDFs, not the current date. Based on what I've read about watermarks, they're static images created at the time of insertion and won't work for what I want it to do.

2) Import as layer - I tried to import the "dateprinted.pdf" document as a new layer. Again, everything looked fine initially... I could place it where I wanted it to be, and the date was displaying just fine. But the next day, same issue - the date hadn't updated.


With the limited knowledge of Acrobat and Javascript I have, it seemed at first like these made sense and would work as solutions for me. But I realize now that having the date field and javascript in a secondary PDF and inserting/embedding that into another PDF isn't doable.

Is there a way to prevent the purple "form" bar at the top from showing up when someone opens the document in Reader?
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4307
Accepted Answer
Button fields are treated differently than other form fields since they are designed to only run actions and not take any input values without special scripting. Setting the button to read only disables the pushing of the button and other user interaction with the button.

Watermarks are like the real world watermark on paper, once on the paper page, you can not change it. JavaScript only allows the adding of a watermark while the Acrobat program allows one to update or delete the watermark.

Since the script I posted does not have a variable oDate, it should read:

this.getField('Button1').buttonSetCaption(util.printd("mmm d, yyyy h:MM tt", new Date()));

George Kaiser

kapoli
Registered: May 6 2011
Posts: 6
Thanks for your help George, I'll give that a shot!