Skip to main content
Participating Frequently
November 1, 2005
Question

Add current date to PDF documents

  • November 1, 2005
  • 127 replies
  • 43042 views
This doesn't seem like it should be hard, but I have been unable to find information on how to do it.

I have about 100 PDF files. Somewhere on them, I need to display "Date Printed: dd mmm yyyy", and have the current date displayed.

I don't care whether this is placed at the top of the page, the bottom, or opaque in the background.

I would like to be able to accomplish it using the batch command, but will perform manually if necessary.

I have Acrobat 7 Professional.

Can someone please help me out?
    This topic has been closed for replies.

    127 replies

    Participant
    February 2, 2011

    Well I have been using a small powerful utility for watermarking called A-PDF Watermark. This can be used even to batch add watermarks and supports show current date only when printing the PDF document and hide when viewing the document. This is fairly simple to use and you need not write any scirpts. Demo verson is available at http://www.a-pdf.com/watermark/index.htm check it out.

    Bernd Alheit
    Community Expert
    Community Expert
    April 3, 2009
    Looks like that you don't allow changes of the document.
    Participant
    April 3, 2009
    Thanks Bernd!

    This code is working if I don't put any password for secure.

    That means date is changed whenever I print out the file.

    If I print yesterday, the date is shown yesterday's date and

    if I print today, the date is shown today's date.

    But after I put the password, the date shown is same date always.

    I want make it works whenever I print the file, date shown on

    that day's date that I print out even after I put password on the

    file. (This code is not for that???)
    Bernd Alheit
    Community Expert
    Community Expert
    April 3, 2009
    This JavaScript code adds only a expiration date to the document.
    Participant
    April 2, 2009
    I apply aboved #109 javascript on Acrobat 9 Pro Extended.
    It is fine to print date. BUT when I lock the file with password in menu (Encrypt with Password --> Security ---> Advanced menu), printed date is always same and never changed.
    What was the problem in this case???
    Is there any solution???
    Please Help!!
    John T Smith
    Community Expert
    Community Expert
    March 10, 2009
    There is also the Acrobat Scripting Forum http://www.adobeforums.com/webx?13@@.3bbedaa6
    Thom Parker
    Community Expert
    Community Expert
    March 10, 2009
    You could place a script in the WillPrint event to place the current date and time in a file.

    something like this (for a field named "PrintDate"):

    this.getField("PrintDate").value = util.printd("ddd mmm d, yyyy hh:MMtt",new Date());

    Thom Parker
    WindJack Solutions
    The source for PDF Scripting Info
    pdfscripting.com

    The Acrobat JavaScript Reference, Use it Early and Often
    http://www.adobe.com/devnet/acrobat/javascript.html
    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
    Participant
    March 9, 2009
    I have a slightly simpler situation, but my JS experience is very light.

    I have Adobe Pro 7; modifying a .pdf I got from a health ins. web site. I have added several fields to make submitting this form more useable. I would like to print the "date printed" on the form. I have added a text field and don't see anything in the Properties of this field where I can grab the system date value, although I control the format for entering a date manually using the Format tab.

    Is there a simple set of code I can paste into the Calculate tab, either in the Simplified field notation box or Custom calculation script, that will value this field automatically?

    Thanks in advance. This is a long way from APL, COBOL, Fortran, etc.
    RA
    Participating Frequently
    January 10, 2009
    Thanks for explaining your idea. I'll try it your with a button, using your tutorial, then see if I can get it working in a batch.
    -Tom
    Thom Parker
    Community Expert
    Community Expert
    January 10, 2009
    Well, I didn't mean a Batch script exacty, but that is certainly an option. In fact, it's perfect for handling lots of PDFs at one time.

    What I was refering too is a little different. From a folder level JavaScript, you can create a toolbar or menu item in Acrobat. This toolbar or menu item runs a script that operates on the current PDF. You could think of it as a way to create Macros in Acrobat.

    The toolbar button or menu items is for operating on one PDF at a time and the batch script is for operating on multiple PDFs. But that doesn't mean you can't have the best of both worlds. I usually create the toolbar button script first, to validate the idea. I'll put all of the functionality in to a function that's written in a general enough way to also work for a batch script. Then I'll write a batch script that just calls the function.

    This approach gives you the ability to easily modify single PDFs, or an entire folder.

    Thom Parker
    WindJack Solutions
    The source for PDF Scripting Info
    pdfscripting.com

    The Acrobat JavaScript Reference, Use it Early and Often
    http://www.adobe.com/devnet/acrobat/javascript.html
    Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often