2 Replies Latest reply on Mar 29, 2012 6:38 AM by hdurand16

    Help with Will Print - Current Date to apply to several hundred files




      So I've spent all morning trying to find a solution for my problem, but I know nothing about Javascript, and the more detailed answers I've found are that give step-by-step tips are for older versions of Adobe (I have Adobe Acrobat X Pro).


      My Situation: I have several hundred SOP PDFs that I wanted to add "Printed On: current date" and "Notice: Printed copies of SOPs are only valid for 30 days past "Printed On" date. Printed SOPs must be disposed of by confidential shredding." in the footer. These PDFs are then linked to our intranet where all employees open them to print.


      What I Did: I went to Tools>Pages>Add Header & Footer entered all the information, entered the "Insert Date" then clicked "Apply to multiple files" and thought that I had done everything. However, the date is not changing...it is staying on the date that I did the whole batch of files with the "apply to multiple files"


      What I have found is that evidently i need to do batch processing, with the will print java script to put the following code in (but i'm not sure if this code will put it in the footer?):

      var f = this.getField("Today");

      f.value = util.printd('dddd mmmm dd yyyy h:MM tt   ', new Date())


      but i have no idea where to get to batch processing, will print, etc.


      I can redo the apply to multiple files so that only the "notice" part will be on the right part of the footer, but can some nice forum person give step-by-step for dummies instructions on how to fix this so the date is current on the left part of the footer whenever someone opens the file?




        • 1. Re: Help with Will Print - Current Date to apply to several hundred files
          try67 MVP & Adobe Community Professional

          Batch processing has been renamed "Actions" in Acrobat X. You'll find it under Tools - Action Wizard. There you can create a new Action and add this code as a WillPrint event by using JavaScript (don't bother with the built-in Document Actions command, it's useless) and the setAction() method of the Document object.

          This code assumes there's a text field in the file called "Today". So you can use the same JS command to insert that field as well, by using the addField method of the Document object. This allows you to place the fields exactly where you want it to be...

          • 2. Re: Help with Will Print - Current Date to apply to several hundred files
            hdurand16 Level 1

            Right, so I did find the Actions section under tools....So I did Create New Action>More Tools>Execute Javascript


            Then I clicked on the little "Options" box, and all that pops up is an empty javascript window with "/* Put script title here */" Is that were I paste the code I had? Do I leave the /* or erase everything and put the code? Also, i don't see anything about adding a field....


            ...sorry to be dense about this, but this is way beyond anything i've attempted in acrobat. I do appreciate your help though.


            Also, what options will i want selected on the "start with" and "Save to" options...i don't want the end users to have to mess with any prompts or anything, will Start With > a file open in acrobat run the script as soon as that file is opened via the intranet? Also, i'm assuming i then want "don't save changes" so the date will always change? Thanks.