In this tutorial, learn how to insert date stamps to fillable PDF forms that will only appear when an end user prints your PDF form using Acrobat X or XI. When designing a form in Acrobat X or XI Std. or Pro., there may be times when you want to know the date that a user completes or prints a form.
This is a simple two-step process that starts by clicking the Tools Pane, Forms panel, and selecting the Edit command. We'll begin by adding a New Text Field to hold the actual date. And give it a name. In this example, I’ll call mine DatePrinted. In the Properties dialog select Hidden from the Common Properties and check the Read Only box. Now we're going to exit Form Editing mode.
In the second part, we’ll be using a simple JavaScript to add the current date, which is based on the computer system clock. So we’ll open the JavaScript panel located under the Tools pane. And if you don’t see this panel, look under the small flyout menu at the top of the Tools pane. Select the Set Document Actions from the JavaScript panel, and click on the Document Will Print action, since we want the date to appear when the form is printed, and click the Edit command. In the JavaScript editor type the following code:
var f = this.getField("DatePrinted"); f.hidden = false; f.value = "Printed on: " + util.printd("mmm dd, yyyy", new Date());
In this simple three line script, we first assign variable f to the field where we are adding a new date. And then in the second line we show the field since it's initially hidden and then in the third we add the actual date. Now to test out this functionality, I’m going to go ahead and print my form to PDF and then view the resulting file. Here you can see our read-only date stamp, printed on a new document.
Products covered: |
Acrobat XIAcrobat X |
Related topics: |
PDF Forms |
Top Searches: |
Convert existing forms to fillable PDFs fill and sign PDF online |
Try Acrobat DC
Get started >
Learn how to
edit PDF.
Post, discuss and be part of the Acrobat community.
Join now >
7 comments
Comments for this tutorial are now closed.
Lori Kassuba
3, 2014-03-20 20, 2014Hi Javier N,
Can you post your question in this discussion about how to do this on multiple files?
http://answers.acrobatusers.com/How-print-current-date-printing-file-q35204.aspx#postComments35206
Thanks,
Lori
Javier N
5, 2014-03-18 18, 2014Hi Lori,
Can you apply the date stamps to multiple documents simultaneously? what is the method?
Also can you include together with the date stamp, a wording such as “expires one day after the print date”
what is the method?
Thank you.
Lori Kassuba
5, 2014-01-21 21, 2014Hi Janet,
Have you considered using a watermark to do this instead?
Lori
Janet
3, 2014-01-17 17, 2014Hi Lori,
Thanks. I had a typo. A thought for a part-4, how to add print date to multiple pages.
Lori Kassuba
2, 2014-01-17 17, 2014Hi Janet,
Did you place the script on the “Document Will Print action”? It cannot be used in a calculation script associated with a specific field.
Lori
Lori Kassuba
2, 2014-01-17 17, 2014Hi Daniel,
Please see this post for information on how to show the date when opening a PDF:
http://answers.acrobatusers.com/Force-field-current-date-q35598.aspx
Thanks,
Lori
Janet
3, 2014-01-14 14, 2014Hi Lori,
Why doesn’t the date change? My document retains the original date.
Daniel
3, 2014-01-13 13, 2014Hi,
How to show todays date when just opening the pdf?
I’m using Adobe X Pro
Lori Kassuba
2, 2014-01-13 13, 2014Hi Jennifer,
This JavaScript tutorial should help you add the time:
https://acrobatusers.com/tutorials/print/working-with-date-and-time-in-acrobat-javascript-part-3
Thanks,
Lori
Jennifer
1, 2014-01-07 07, 2014Hi Lori,
Thank you. That is great and very helpful.
How can I add “time” into this scrip?
L Ford
4, 2013-09-17 17, 2013Very slick feature.
Tarek Faham
11, 2013-08-29 29, 2013Great! I really liked this video.
Comments for this tutorial are now closed.