Current Date in PDF

Help - I am converting a Word file to PDF.  I need the PDF (without being a form) to include a date that updates to the current date each time the file is opened.  Can anyone help me?

It's OK, I'll explain it. So here's what you do:
- Create a new Text Comment on the first page in the location where you want the date to appear and select it using the Object Select tool under Tools - Interactive Objects.
- Open the JS Console by pressing Ctrl+J.
- Enter the following code into the console window, select it with the mouse and press Ctrl+Enter:
this.selectedAnnots[0].name = "DateAnnot";
this.selectedAnnots[0].readOnly = true;
this.selectedAnnots[0].lock = true;
- Go to Tools - JavaScripts - Document JavaScripts.
- Create a new item, let's call it "scripts".
- Delete the default code that is generated and paste this code instead into the window:
this.getAnnot(0, "DateAnnot").contents = util.printd("mm/dd/yyyy", new Date());
Feel free to adjust the date pattern string, as you see fit.
- Click OK, Close, and then save the file. Each time you open it from now on the text comment will contain the current date.

Similar Messages

  • Current Date on PDF Document

    I have a current pdf document created in Adobe Acrobat 9.0 Professional. At the bottom of each page, I would like for the current date to be displayed whenever someone prints a copy of the document. Can anyone give me an easy way to do this? I added a footer thinking originally that it would automatically update to the current date but I see that it doesn't. It just displays the date of the last update. Thanks.

    First, Reader can not add form form fields or water mark by JavaScirpt. This means one can not add a watermark reliably before printing, so one needs to use a form field, and that form field needs to exist before the PDF is opened by Reader. You need to add a 'read only' form field to each page of the PDF and if you give them all the same name, you only need to change the value of one of the form fields. There is no way to add a footer by JavaScript.
    There are a number of ways to change the value of the field before printing so if you want the date the form was sent to the printer, you will use the 'Will Print' document action to change the value of the field which will cause the field to be updated when any 'print' is requested from Acrobat's menu, Acrobat's tool bar, or an added button field. And you will have to add a custom JavaScript that obtains the date object, formats the date object,  and sets the value of your field object.
    The referenced link is to JavaScript that adds the field and the necessary JavaScript to work.
    You can cut and paste the following into the script for the 'Will Print' action:
    // get the field
    var field = this.getField("PrintField");
    // get the date object
    var odate = new Date();
    // format the date
    var cDate = util.printd('mmm d, yyyy', oDate)
    // set the field value
    field.value = "THIS DOCUMENT WAS PRINTED ON "+ + cDate;

  • Logotype and Current Date in PDF - Web Applications

    Is possible to insert an image (company logotype) and a text (title and date) in PDF generate through “Printed Version” functionality? The generated PDF only contains result table of the report.
    By the way, how can I insert current date in a web application? I don’t want to use javascript because javascript would return de time/date of the end user computer.
    Thanks in advance.
    Best regards,
    Raphael Barboza

    Hi Raphael,
    Q1) Is possible to insert an image (company logotype) and a text (title and date) in PDF generate through “Printed Version” functionality? The generated PDF only contains result table of the report??
    A)In PDF Print Properties you should be able enter "Title and Date" and also When you define command sequence make sure to call "Analaysis Item only" otherwise the whole template will be downloaded to PDF. Please play with the properties when defining Command Sequence.
    Q2) how can I insert current date in a web application? I don’t want to use javascript because javascript would return de time/date of the end user computer ???
    A) Use Web Template "TEXT ITEM" and in the web item properties "LAST UPDATED or KEY DATE" is the property you should assign.
    Sorry I dont have my system as of now to send you code for these but they are pretty easy.
    thanks,
    Deepak
    SAP BI Consultant
    D N Tech

  • Add current date to PDF documents

    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?

    Hi Everyone -<br /><br />Thanks to Dimitri, I was able to do exactly what I wanted to do by using the following code:<br /><br />  // Check for existing field and make sure it's on the first page<br />  var strModName = "DocMessage";<br />    var ofield = this.getField("DocMessage");<br /><br />     // Create Field if it doesn't exist<br /><br />    if(ofield == null)<br />    {<br />       // Field is the width of the page, on the bottom of the page<br />       // and 40 points high (72pts/inch)<br /><br />       for(var i=0;i<this.numPages;i++)<br />       {<br />         var rectField = this.getPageBox("Crop",i);<br />         rectField[1] = rectField[3] + 14; // Set Top<br />         ofield = this.addField({cName: strModName,cFieldType: "text",<br />         nPageNum:i ,oCoords: rectField});<br />         ofield.alignment = "center"; //This is the text alignment of the field<br />         ofield.multiline = true;<br />         ofield.textSize = 8; <br />         ofield.textFont = "Arial";<br />         ofield.display = display.noView; //This is hidden on the page but printable to make viewable change to display.visible or noView<br />        ofield.readonly = true;<br />       }<br />    }<br /><br />    // Add Field to Document Script<br />    var strJS = 'var ofield = this.getField("DocMessage");';<br />    strJS += 'ofield.value = "Intellectual Property of My Company - CONFIDENTIAL. ";';<br />    strJS += 'ofield.value += " Document printed " + util.printd("ddmmmyyyy",new Date()) + ".";';<br />    this.addScript("AddMessage",strJS);<br /><br />However - Now I would like to change the message to say that the document expires on a future date. For example, 14 days from today. I found an example of how to do this on page 266 of the Adobe JS Scripting Guide and have followed it to the letter, but it is not working. Here is the modified code:<br /><br /> // Check for existing field and make sure it's on the first page<br />  var strModName = "DocMessage";<br />    var ofield = this.getField("DocMessage");<br /><br />     // Create Field if it doesn't exist<br /><br />    if(ofield == null)<br />    {<br />       // Field is the width of the page, on the bottom of the page<br />       // and 40 points high (72pts/inch)<br /><br />       for(var i=0;i<this.numPages;i++)<br />       {<br />         var rectField = this.getPageBox("Crop",i);<br />         rectField[1] = rectField[3] + 14; // Set Top<br />         ofield = this.addField({cName: strModName,cFieldType: "text",<br />         nPageNum:i ,oCoords: rectField});<br />         ofield.alignment = "center"; //This is the text alignment of the field<br />         ofield.multiline = true;<br />         ofield.textSize = 8; <br />         ofield.textFont = "Arial";<br />         ofield.display = display.noView; //This is hidden on the page but printable to make viewable change to display.visible or noView<br />        ofield.readonly = true;<br />       }<br />    }<br /><br />    /* Create a date object containing the current date. */<br />    var d1 = new Date();<br />    /* num contains the numeric representation of the current date. */<br />    var num = d1.valueOf();<br />    /* Add fourteen days to todays date, in milliseconds. */<br />    /* 1000 ms/sec, 60 sec/min, 60 min/hour, 24 hours/day, 14 days */<br />    num += 1000 * 60 * 60 * 24 * 14;<br />    /* Create our new date, 14 days ahead of the current date. */<br />    var d2 = new Date(num);<br />    // Add Field to Document Script<br />    var strJS = 'var ofield = this.getField("DocMessage");';<br />    strJS += 'ofield.value = "Intellectual Property of My Company - CONFIDENTIAL. ";';<br />    strJS += 'ofield.value += " Document expires on " + util.printd("ddmmmyyyy", d2) + ".";';<br />    this.addScript("AddMessage",strJS);<br /><br />The resulting output is simply: "Intellectual Property of My Company - CONFIDENTIAL." The part of the message regarding the expiration date doesn't even show up.<br /><br />Anyone have any suggestions?

  • Embedding a "Current Date" field in a pdf document

    To assure people work to the latest authorized version of a procedure, we let them access a protected pdf version on our Intranet. They can print a copy for use, but the copy is valid ONLY for the date printed, which is shown in the footer of each page. The "current date" field is updated when the document is opened by way of a Java script that reads:
    var f = this.getField("Today");
    f.value = util.printd("mm/dd/yyyy", new Date());
    (Obviously, "Today" is the field's name.)
    If a person were to open the same document three days later, that later date would be embedded.
    All this worked well when we were using Acrobat 5 and Reader 5. Now, to keep up with the times, we've upgraded to Acrobat 8 and Reader 8 on many PCs. However, the "current date" field still works for those still using Reader 5 but doesn't work for those using Reader 8.
    What I'm wondering is whether the scripting has changed for Acrobat 8. I can't find anything in the Acrobat support documents for Java scripting, but I may not know what I'm looking at.
    Thanks,
    Jerry Holt
    [email protected]

    The problem has been solved!!!
    The form field, the accompanying script, and most documents' security were set up in Adobe 4.0. However, in Adobe Reader 7 or higher, "no changes" means "no changes," so the form field script was blocked.
    By setting Compatibility to "Acrobat 7.0 or greater," I could choose the "Change Allowed" option: Filling in form fields and signing existing signature fields.
    Then, all I needed to do was to confirm that the JavaScript "Today" was still applied, and the current date was immediately filled in.
    Thanks for the questions and suggestions.

  • Java code to show current date & time on PDF

    Hi,
    I have no experience with Java whatsoever and I am hoping somebody out there will be able to help me. Basically we are in the process of uploading all our SOP's to a public share on our Network. Due to regulatory reasons everytime the document is opened it will need to show the current date which will also show when printed. I have adobe 9 pro and see there is a area that you can input Java code so with the power of Java im sure this can be done. Ideally this would be like a watermark across all the page diagonally faded into the background of each page on the PDF.
    Only Valid on Date of Printing
    Date Printed: <Current Date>
    Any help would be much appreciated.

    Are you sure you haven't committed one of the cardinal sins of the Java-ignorant by confusing it with Javascript?

  • How to put current date in File name while saving PDF file.

    Hi expert,
    A report is scheduled for broadcasting  in PDF format . User wants it should have current date in its file name.
    Now system generated file name is Z_XXX_YYY_0000.pdf , but it should have Z_XXX_YYY_10012012.pdf or in any date format.
    Regards,
    Anand Mehrotra.

    First, how to best change the name of the folder. In Library view, there is a Folders panel within the lest hand side panel. If you select the folder and bring up the context menu, you can select the rename option to change the name/date of the folder. Lightroom will also cause the name to be changed on the HDD so both Lightroom as well as the OS will know about the change. This is the simplest way to handle folder name changes.
    Renaming the photos contained within the folder is a bit trickier. I have tried the Lightroom batch rename function, which should work by the way, I encountered some issues in which Lightroom wanted to substitute a sequence number, starting at 0001 rather than use the starting number I wanted to use. This was in Lightroom 4.x and I ended up having to manually rename files. To rename the files within the folder, select the folder to display the grid view of the images within that folder. Next, select all of the photos you want to rename and then select Library/Rename Photos (must be in Library mode) or just press the F2 key. This will open a Rename Photo dialog. Use the drop down box to select your naming scheme (or custom, which will open the Filename Template Editor where you can build your own template. From there, just click to confirm your choices and you should be able to rename your files.
    As I said above, I did have trouble with this in V4.x so I suggest only selecting one of the photos and testing it out. If it works, you can select the rest and complete your task. If it doesn't, then you can fix that, try again to get it to work or just manually rename your photos which is what I ended up doing.

  • Adding Current Date Using A Prologue File When Converting to a PDF

    I'm trying to embed the current date on a postscript file (.ps) to pdf conversion using a prologue file (prologue.ps) in a certian position on the page. What is the script necessary to acommplish this task? Is this similar to the case that is still open regarding a "dynamic date stamp"?

    Hi Bill -- thanks for your reply!
    When I check the Document Properties on Acrobat I can see that the fonts used in the document (Cambria, Times and Windings) are listed as "Embedded Subset" in the Fonts panel. The machine it was created on did use an earlier version of OS X and an old version of Word, but it seems to have the proper fonts...
    -nick

  • Future Date Script in Acrobat, 6 months after current date

    Hey guys I have been working on this for hours and I am not sure why I cannot figure this out.  I am looking to have 1 field box in the form auto populate the current date and another field box to auto populate a date 6 months from the current date.  My current date code is attached, I have been playing around with so many variations that I do not want to confuse anyone with my other ugly code fragments.
    var bFirstTime=1;
    var f=this.getField("todaysDate");
    if (bFirstTime=1) {
    f.value=util.printd("mm/dd/yyyy",new Date());
    bFirstTime=0;
    //app.bFirstTime);

    Have you tried a document level funtction that runs when the PDF is opened. The following script fills in today's date if the field has not been field in and computes the date in 5 months using the parts of the date and the value of today's date.
    // one time use document level function
    ( function () {
    // update fields only if balnk
    if(this.getField('todaysDate').defaultValue == '') {
    // get current date time object
    var oNow = new Date();
    // get some date parts
    var fYear = oNow.getFullYear(); // 4 digit year
    var fMonth = oNow.getMonth(); // get zero based month
    var fDate = oNow.getDate(); // get date of month
    var sFormat = '%,302.0f/%,302.0f/%,304.0f';
    // fill in field
    this.getField('todaysDate').value = util.printf(sFormat, (fMonth + 1), fDate, fYear);
    // make permanent
    this.getField('todaysDate').defaultValue = this.getField('todaysDate').value;
    // compute date 6 months from today
    fMonth += 6;
    var oNew = new Date(fYear, fMonth, fDate);
    // get some date parts
    fYear = oNew.getFullYear(); // 4 digit year
    fMonth = oNew.getMonth(); // get zero based month
    fDate = oNew.getDate(); // get date of month
    // fill in field
    this.getField('newDate').value = util.printf(sFormat, (fMonth + 1), fDate, fYear);
    // make permanent
    this.getField('newDate').defaultValue = this.getField('newDate').value;
    // debugging aid
    app.alert('dates updated', 2, 0);
    } else {
    app.alert('dates not updated', 1, 0);
    } // end not empty
    return;
    } // end function
    () // call funtion
    ); // end document level function

  • Acrobat 9 - how do you create a dynamic stamp to include the current date (java script)

    I have seen my question multiple places and times but the resolutions provided have not worked for me.
    I am running Acrobat 9 Pro, cannot run X or XI due to the use of ProSystem fx Engagement.
    I want to create what I thought would be a simple stamp. My initials and the current date. i.e. "crm 01/10/13".
    Simple right? I created a PDF of my initials. Now I just need the text field with the proper Java Script to insert the date, correct?
    I have tried opening "Dynamic.pdf" and copying and pasting the text field that includes the Java Script:
    " event.value = (new Date()).toString(); AFDate_FormatEx("h:MM tt, mmm dd, yyyy"); "
    The date does not update, it stays static.
    I have manually entered the Java Script.
    I have edited the Java Script to remove the "Ex".
    I have edited the Java Script to revise the "yyyy" to "yy".
    I have edited the Java Script to remove the " h:MM tt, " trying different formats to get "dd/mm/yy".
    I have selected "Use single-key accelerators to access tools" in Preferences/General.
    I have tried PDF files, PNG files. I have created the image files from Word and Excel.
    I am at my wits' end. Can someone PLEASE assist me to resolve what should be a simple issue (I hope).
    Thank you in advance.

    Thank you for your response.
    Your script works well, but I still have the same issue.  The date is remaining static to the system date when the stamp is created.  My initial idea was to create a pdf of my initials "crm" and then add the text field with the java script for the date behind my initials.  "crm" + (TEXT FIELD with JS).  I wanted 3 stamps, red, blue and green.  The colors correspond to specific processes in our workflow.
    Your script adds my initials as well as the date.
    My machine is running Windows 7.
    My stamps are located:
    C://Documents/Acrobat Stamps/...
    Acrobat templates:
    C://Program Files (x86)/Adobe/Acrobat 9.0/Acrobat/plug_ins/Annotations/Stamps/ENU/...
    I have no problem creating stamps, just a stamp that will use the current system date.  I HATE using the typewriter for my initials and the date.  I guess I can stamp my initials and then type the date...but what is the point?
    Do you have any further thoughts or suggestions?
    Thank you very much.
    crm 01/11/13 

  • A script for adding the current date to file name?

    I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?

    ok, I ended up with this test routine:
    on adding folder items to this_folder after receiving added_items
    tell application "Finder"
    repeat with this in added_items
    my checkifopened(this)
    display dialog (name of this) as text
    end repeat
    end tell
    end adding folder items to
    on checkifopened(this)
    set a to POSIX path of (this as alias)
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    exit repeat
    else
    say "still opened"
    end if
    end repeat
    end checkifopened
    this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
    And after adding a timeout (just in case) to this function the final script looks like this:
    on adding folder items to thefolder after receiving added_items
    tell application "Finder"
    set folderkind to kind of thefolder
    set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
    repeat with myfile in myfiles
    set myfile_datestring to my get_datestring(creation date of myfile)
    set myfilename to name of myfile
    if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
    set filestatus to my checkifopened(myfile, 60)
    if filestatus = false then
    display dialog "timeout on folder action"
    else
    set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
    set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
    set name of myfile to myfilename
    end if
    end if
    end repeat
    end tell
    end adding folder items to
    on get_datestring(mydate)
    return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
    end get_datestring
    on checknamewith_pdfsuffix(n, D, looped)
    --check if filename exists in D
    -- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
    #n = string of the filename
    #D = file reference to the directory to check
    #looped = boolean used for recursive loop...
    tell application "Finder"
    set thefiles to name of every item of (D as alias)
    end tell
    if thefiles contains n then
    if looped = false then
    set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    else
    set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
    set tmpcount to (count of characters of (tmp as text)) + 5
    set tmp to tmp + 1
    set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    end if
    else
    return n
    end if
    end checknamewith_pdfsuffix
    on checkifopened(this, mytimeout)
    ## this file reference
    ## timeout in seconds
    set a to POSIX path of (this as alias)
    set startdate to current date
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    return true
    else if ((current date) - startdate) > mytimeout then
    return false
    else
    ##say "still opened"
    end if
    end repeat
    end checkifopened
    to use this save this script in /Library/Scripts/Folder Action Scripts
    and add this as a folder action to your folder...
    The script processes all files inside that folder each time a new files is added...

  • Current Date

    I just added from the Custom Tab from the Library Pallet the Current Date object to my form.
    On the Object Pallet, the Field tab is set as follows
    Appearance : None
    Display Pattern: YYYY-MM-DD
    Edit Pattern: MM-DD-YYYY
    Locale: Viewer's system locale
    On the Value Tab
    Type: Read Only
    On the Binding Tab
    Name: Current Date
    Default: None
    Data Pattern: YYYY-MM-DD
    Data Format: Date
    When I click on PDF Preview it just hangs.
    So I went into the script editor and changed
    $.rawValue = num2date(date(), DateFmt(1))
    to
    $.rawValue = num2date(date(), DateFmt(2))
    The Preview still hangs.
    But when I open it up in Acrobat Reader the four digit year is visible.
    Do I have something setup wrong or is there a problem.
    I also tried bringing the Current Date object into a blank print only form and had the same problem with the PDF Preview, did not save the test so I did not open it in the Reader only. ( I am working on a 2 desktop system. Professional in on the first desktop and the reader is on the second.)

    It seem to be working today. Sorry about any that.

  • Can i get current date in XSL FO customized file with Apex 3.0??

    Hi Oracle staff,
    i have a problem with the insert of current date in customized layout's XSL FO file..
    I have just tried to insert current-time() function and js scripts....but nothing.....PDF,Word or HTML output file that's printed by Bi Publisher displays an error that says:"Content file not supported or damaged".
    Why???is Bi Publisher a XSLT processor that supports currrent date functions????.
    and if not.....how can i install a new processor in substitution of Bi Publisher/Apache FOP???
    Regards
    Emanuel

    Yes, you can click the title bar of any document (the down arrow) to access the current file name:

  • How to create a Date or time field that automatically saves current date or time?

    hello,
    i want to know that how to create a Date/Time field that automatically shows current Date/Time when .pdf form is opened.
    also want to how to stop user to give input in Date/Time field
    currently im putting a Date field but it is accepting user input.
    hoping for quick response
    Thanks in advance!

    You can place the below code in the initialize event of the field to display the current date and time.
    Set the language to FormCalc.
    You can play around the formats to get the desired format of date and time.
    if($.rawValue eq null or $.rawValue eq "") then
    $.rawValue = Concat(Num2Date(Date(), "MM/DD/YYYY")," ", Num2Time(Time(), "h:MM:SS A"));
    endif
    You can not restrict the input area in Date time field instead you can validate the input while existing the field.
    (OR) set the field to either readOnly or protected mode.
    Thanks
    Srini

  • How can I make the current date/time be sent when emailing as XML?

    I'm creating a form for a customer to use for submitting print jobs. This customer will be emailing the XML form data, which will in turn be converted into a production order. I'd like to make the PDF form capture my customer's system time, so that I know when they filled out the form. I COULD just leave that up up the customer and use required current date and time fields, but that provides the ability for the customer to falsify that information.
    Is there any good way to capture the current date/time in the XML data, so that the customer doesn't need to nor has the ability to?
    Any suggestions would be great!

    You can use the following methods getHours(),getMinutes(), and getSeconds() from the date object to obtain the values for hour,minute,and second.
    Click here to see an example:
    http://66.34.186.88/LiveCycleSamples/.3bbc2f4b.pdf

Maybe you are looking for