These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Save copy of PDF with date & time worked in 5.0 but not in 9.0 Reader

webmaster
Registered: Jan 26 2007
Posts: 8

Hi,

I inherited a PDF form that used an external script to save a copy of the file with the date and time appended to the filename when submitted. This worked in Acrobat 5.0 but now we have upgraded to Acrobat 8.0 and have saved it with "Enabled Usage Rights in Acrobat Reader" so that the users only need Reader 9.0 to use it.

The external javascript file: saveIt.js is located: C:\Program Files\Adobe\Reader 9.0\Reader\Javascripts

The saveIt.js file only has one line of code:

app.addMenuItem({ cName: "saveIt", cParent: "File", cExec : "var d = new Date(); this.saveAs('/c/folder/filename_' + util.printd('dd-mmm-yyyy_hhMMsstt', d) + '.pdf');", nPos: 0});
The code is called in the form (saveForm.pdf) when the submit button is clicked:

app.execMenuItem ("saveIt");
It used to work in Acrobat 5.0 but now it doesn't work in Acrobat 8.0 or Reader 9.0.

For a variety of reasons we are using Acrobat not LifeCycle Designer.

Please advise if the coding needs to be updated for Acrobat 8.0 or should it be completely rewritten?

[i]P.S. [color=blue]Am a javascript novice.[/color] Thanks for helping![/i]

My Product Information:
Acrobat Pro 8.1.6, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
execMenuItem has become a restricted function, which needs to be placed in a folder-level script in order to be used from a form field. Have a look here: http://www.acrobatusers.com/forums/aucbb/viewtopic.php?id=13999

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com