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;

Similar Messages

  • 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?

  • 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.

  • 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

  • Copying Data In PDF Documents

    Am I missing something? Sometimes I am able to copy text and numbers out of certain PDF documents but not others. Is there a "lock" on the data and is there a way to get around this?
    Thanks in advance.

    >Is there a "lock" on the data
    Maybe. Or they could possibly be a scanned document so there wouldn't be any "data" to copy.

  • Replacing net due date with current date in invoice document

    Dear all,
    We  are having a functionality of replacing the net due date in the current date  with reference to the Posting area entry. in the invoice document .Can anybody tell me where and in which event we can maintain this .
    Susmita

    The obvious answer here is to have payment terms which are due immediately, and then set the transaction to use the posting date as the baseline date - that is done in the main/sub definitions within the TE305 customizing.
    regards,
    bill.

  • (Urgent)help: how to use sdk add a gif image into a pdf document

    I had use sdk plus-in add a new button of mine,if I click the button,a gif image will be inserted into the current page of pdf document
    My questions:
    one : When I clicked the button,there was a warnning box said:the image has not enough data.I don't known why?
    two : How can I be sure the position of the image which I inserted? and how to change it's position?
    three:  how to use sdk get the content of the document?

    hi Leonard:
    I do it like you said, but
    Why my image can not display in the pdf.
    code is:
    //====================================================================
    const ASInt32 theImageByteSize = IMG_WIDTH * IMG_HEIGHT;
    char* buff = new char[theImageByteSize];
    PDEImage volatile pdeImage = NULL;
    PDEImageAttrs pdeImageAttrs;
    PDEColorSpace pdeColorSpace;
    ASFixedMatrix imageMatrix;
    memset(&pdeImageAttrs, 0, sizeof(PDEImageAttrs));
    int hdl = _open(ImagePath, _O_RDONLY | _O_BINARY, _S_IWRITE | _S_IREAD);
    if (hdl == -1)
         AVAlertNote("[%s] create fail !!!!") ;
    if (_read(hdl, buff, theImageByteSize) == -1)
         AVAlertNote("read image fail!") ;
    pdeImageAttrs.width = IMG_WIDTH;
    pdeImageAttrs.height = IMG_HEIGHT;
    pdeImageAttrs.intent = ASAtomNull;
    pdeImageAttrs.bitsPerComponent = 8;
    pdeImageAttrs.flags = kPDEImageExternal | kPDEImageIsIndexed;
    pdeImageAttrs.decode[0] = fixedZero;
    pdeImageAttrs.decode[1] = fixedOne;
    pdeImageAttrs.decode[2] = fixedZero;
    pdeImageAttrs.decode[3] = fixedOne;
    pdeImageAttrs.decode[4] = fixedZero;
    pdeImageAttrs.decode[5] = fixedOne;
    ASFixedRect theMediaBox;
    PDPageGetMediaBox( AVPageViewGetPage(pageView), &theMediaBox );
    ASFixed theFixedWidth = (theMediaBox.right - theMediaBox.left);
    ASFixed theFixedHeight = (theMediaBox.top - theMediaBox.bottom);
    imageMatrix.a = ASInt16ToFixed(theFixedWidth);
    imageMatrix.d = ASInt16ToFixed(theFixedHeight);
    imageMatrix.b = imageMatrix.c = fixedZero;
    imageMatrix.h = 0;
    imageMatrix.v = 0;
    const Int32 cPaletteColors = 256;
    PDEIndexedColorData theIndexedData;
    theIndexedData.size = sizeof(theIndexedData);
    theIndexedData.baseCs = PDEColorSpaceCreateFromName(ASAtomFromString( "DeviceRGB"));
    theIndexedData.hival = cPaletteColors - 1;
    unsigned char data[3] = {255, 0, 0};
    theIndexedData.lookup = (char *)data;
    theIndexedData.lookupLen = cPaletteColors * 3;
    PDEColorSpaceStruct theColorData;
    theColorData.indexed = &theIndexedData;
    pdeColorSpace = PDEColorSpaceCreate(ASAtomFromString( "Indexed" ), &theColorData );
    pdeImage = PDEImageCreate(&pdeImageAttrs, sizeof(pdeImageAttrs), &imageMatrix,
                                                0, pdeColorSpace, NULL, NULL, NULL, (unsigned char*)buff, theImageByteSize);
    I want die, I had done this for so many days, My GIF doesn't insert into pdf,
    unsigned char data[3] = {255, 0, 0};
    theIndexedData.lookup = (char *)data;  "
    whether the data set wrong?
    I confused what I do next   

  • How do I add a current date to a form field so that it will give me the current date each time it is opened?

    I have adobe 9 pro. I am currently adding fields to a document and would like my date field to display the current date when the document is opened so that the user does not have to enter the date each time. How do I do that?

    Have you searched for this issue. It has been answered many times.
    Example Acrobat JavaScripts
    Scroll down to the . Insert Today's Date into Form Field section.

  • How to load PDF documents in Clover ETL

    Hi,
    How to use/crawl PDF or Word documents as data readers and load it to bulk add/replace records to create dashboards with the data from PDF documents.
    Suggest the better approach to go about using PDF documents.
    Thanks,
    Chaitanya

    Take a look at the Integrator Access System (IAS).  https://docs.oracle.com/cd/E40518_01/ias.310/ias_developer/toc.htm#About%20this%20guide .  It can process PDF https://docs.oracle.com/cd/E40518_01/ias.310/ias_developer/toc.htm#Vector%20image%20formats .
    You can ingest IAS into Integrator/CloverETL https://docs.oracle.com/cd/E40518_01/integrator.311/integratoretl_users/toc.htm#Loading%20data%20from%20an%20Integrator%…

  • Add hidden data to pdf

    HI
    I need to save some data to pdf document but i want these data be hidden and with preview the document nothing show
    but plugin can read these data
    how can i insert data?
    to where?
    do i have any limitation to add data for example size or ...
    I read 32000 but in sdk I don't know use which function or layer
    thanks for your attention

    I just find this
    http://partners.adobe.com/public/developer/indesign/register/prefix_reg.do
    is this correct ?

  • To Convert ASCII Data to PDF file

    Hello,
    Does any one knows how to convert ASCII data into PDF document using Java. I know there are some 3 party tools available which does this, but i don't want to use any 3 party tools.
    Can help on this matter, doing it using java programming will be appreciated

    if you don't want to use 3rd party tools, then you will need to go read either the source of an app that does it, and port/copy it.
    Or go read the the specs.

  • Printing current time and date on a pdf document

    I wish for a pdf document to print the current time and date in the same place at the foot of each page, to the following format:
    Aug 04 2009, 5:11 pm.
    How do I do this please? Annoyingly I have managed it in the past, but when I open up my old documents and paste the relevant field into my new document, it either prints the old date/time or else prints the present date/time, but then doesn't refresh the next time I try to print - ie it stays at one date/time.
    I'd like to start again from scratch so that I have a better idea of how it works!!
    Regards
    Tony

    Eureka!
    I now have the answer, and hopefully this will help anybody else with a similar problem.
    In Acrobat:
    Create a text field and place it in the chosen place on the pdf form. Label it "datebox" in the General tab of Text Field Properties, and apply your character styles in the Appearance tab.
    Under the "Advanced" menu, go to "Document Processing" and then "Set Document Actions"
    Click on "Document Will Print" and then hit the "Edit" button. In the "JavaScript Editor" paste the following:
    var myfield=getField("datebox");
    var date=new Date();
    date=util.printd("mmm dd yyyy, h:MM tt", date);
    myfield.value=date;
    Hit OK.
    You have now given the instruction that whenever you print, the field named "datebox" will print the current time and date in the following format:
    Aug 05 2009, 9.37 am
    Regards
    Tony

  • 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.

  • Printing PDF document with today's date

    I am looking for a way to print the current date on the PDF
    document. Perhaps, a field/variable/marker on the PDF document
    where it will be converted to the today's date at the time the
    document is being printed.

    Hello,
    I'm sorry I'm not able to address your question. These forums
    are specific to the
    Acrobat.com website and its set of hosted services, and do
    not cover the Acrobat family of desktop products.
    Any questions related to the Acrobat family of desktop
    products would be best suited in the Acrobat User Forums:
    Link to
    Acrobat Forums
    Thanks!
    Michelle

  • 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?

Maybe you are looking for

  • The structure of the profit center report in new GL

    Hello, I must finish a query for the customer this week. This query must base on a sap standard report for the new GL. Because our ECC 6.0 system hasn't the Enhancement Package 3 (contains the necessary new features) yet, so I can't see this standard

  • Updating to iOS 6.1.1 and 6.1.2 wiped all my music TWICE

    I have an iPhone 4S, 32 GB and have updated the OS a few times since I got it without a hitch.  But when I updated my the OS to 6.1.1 the update seemed to run fine and when it was done I restored from the backup I had done just prior to doing the upd

  • Copy/cut paste to USB

    I have a rule in place to deny all application to write to @removable:\** . I assumed this would block anything going to them. I can't do a save or a save as to the USB but I can copy/cut and paste and drag and drop to it. Any ideas on blocking the c

  • Gap between header and content in IE

    Hello All I subscribed to a post with this basic same question but I never got a notification if it got answered or not I all of a sudden have a gap between the header and content on this site http://www.michaelsondesign.com/guestVision/ - I am not s

  • I created a New Apple Id, i verified it using mail but it is not yet Reviewed, and now i dont want want the apple id so how can i delete it??

    My Apple id is not being reviewed because of the Payment option which i dont want.. And that too i din create the apple id using itunes... i did it using a Browser.. And that is the reason why i want to delete the account.. Any Idea how u can do it??