Skip to main content
Participating Frequently
June 26, 2020
Question

mySaveAs function not working

  • June 26, 2020
  • 2 replies
  • 530 views

Hello, Can anyone help me with this?  Below code is working fine on my one machine but not working on other machine. Even everthing is just same as of machine Ist on the 2nd machine.   I have created config.js file with below code at C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\Javascripts

 

Condition if(typeof(mySaveAs) == "function") is returning true on machine 1 and returning false on machine the 2nd. 

please help me out.


var mySaveAs = app.trustedFunction(
function(oPdf,cPath,cFlName)
{
app.beginPriv();
cPath="/c/temp/";
cPath = cPath.replace(/([^/])$/, "$1/");
try{
oPdf.saveAs(cPath + cFlName);
}
catch(e){
app.alert("Oops!! Something went wrong.");
}
app.endPriv();
}
);

  

[Moved from Community Help to Acrobat Reader.]

This topic has been closed for replies.

2 replies

try67
Community Expert
Community Expert
June 28, 2020

If the if-condition returns false it means the script is not installed correctly, or contains an error.

Participating Frequently
June 27, 2020

Can you guys please help me with this.

Legend
June 27, 2020

1. Check the JavaScript console for messages. 

2. You must use your own made up name for this function. Using the name everyone else uses is a security risk.