Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rename PDF and email with Adobe reader 9 script

Status
Not open for further replies.

unslog

Technical User
Jan 25, 2009
25
GB
I want to be able to rename a PDF document in specific format, then provide user option to email PDF as attachment

Problem is it does't work in Adobe Reader 9 , even with Enable menu items Javascript execution privileges

It does work however with Adobe Acrobat Professional 8.


The Debugger throws this error when executing in Adobe Reader 9


RaiseError: This operation is not permitted.
Doc.saveAs:16:Menu Send Document to FCL Client:Exec
===> This operation is not permitted.


I understand that Adobe Reader cannot save any modifications to the the document content, however I not modifying content here, just renaming the document.

in adobe reader there is an option for Save A Copy, is there a javascript equivalent to this command.



or any other options to achieve this?



thanks



app.addMenuItem({
cExec: "SendDoc();",
cParent: "Edit",
cName: "Send Document"
});


function SendDoc() {

var dialogTitle = "Enter number";
var defaultAnswer = "";
var reply = app.response("Please enter 6digit number",
dialogTitle, defaultAnswer);

var myPath = "~~" + reply + "~~" + "Report_" + reply + ".pdf";
this.saveAs(myPath);

this.mailDoc(true, "edocuments@test.com", "cc test@test.com", "", myPath );



return;


Also tried posting the question here: but have had no real help

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top