Skip to main content
August 10, 2020
Question

Adobe Acrobat Reader DC Javascript folder

Hi,

I have been working on some folder-level scripts for a Win10 device which is using a free license of Acrobat Reader DC. I've tried to locate the 'Javascripts' folder on both user and app levels but both are undefined when I used the 'app.getPath("user","javascript");/app.getPath("app","javascript")' functions in the javascript console. I've even tried to manually create directories for them under "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\Javascripts" and "C:\Users\<user>\AppData\Roaming\Adobe\Privileged\DC\Javascripts" and other variants I stumbled across the internet but to no avail. The app just doesn't seem to recognise my .js file no matter where I put it. The current build version of Reader DC for this device is 2020.009.20074

 Please help.

Thanks.

This topic is closed to new replies. Start a new post to keep the conversation going.

6 replies

Bernd Alheit
Community Expert
Community Expert
August 10, 2020

What does you use in the .js file? In the preferences of Acrobat Reader is Javascript enabled?

Translate
August 10, 2020

I have enabled Javascript in the preferences and everything else that's available on the free Reader but I'm not sure that they help. My .js file uses a standard trusted function for a saveAs function, based off the one seen below:

var mySaveAs = app.trustedFunction(
   function(oDoc,cPath,cFlName)
   {
      app.beginPriv();
      // Ensure path has trailing "/"
      cPath = cPath.replace(/([^/])$/, "$1/");
      try{
         oDoc.saveAs(cPath + cFlName);
      }catch(e){
         app.alert("Error During Save");
      }
       app.endPriv();
   }
);

 

Thanks.

 

Translate
Bernd Alheit
Community Expert
Community Expert
August 10, 2020

Any issue using this function?

Have you created the .js file at "C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\Javascripts" or "C:\Users\<user>\AppData\Roaming\Adobe\Privileged\DC\Javascripts" ?

Translate