7 Replies Latest reply on Jan 24, 2014 7:44 AM by try67

    JavaScript fails to execute unless edited first

    MarySmith

      I have associated a document script with the "Document Will Print" action.  When I first open the PDF file and print it, the script fails to execute.  However, if I open the PDF file, then edit the script (without making any changes, just open it, look at it, and click OK) then the script runs fine upon printing.  It's like Acrobat doesn't "see" the JavaScript in there unless I open it and show it there is one there.  (Weird...)  My intent is to have the JavaScript add a footer to the bottom of the page using this.addWatermarkFromText.  However, the odd behavior doesn't seem to be caused by the content of the JavaScript.  I replaced my footer-generating script with

       

      app.alert("Started");

      app.alert("Finished");

       

      and it still behaved the same way.  I'm also pretty sure it isn't a setting on my Adobe Acrobat because I opened another PDF file with a JavaScript associated with the "Document Will Print" action and it worked just fine, regardless of whether I looked at the script before printing.  I am running Adobe Acrobat X Pro.  Any assistance would be greatly appreciated!