• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adobe Acrobat Reader DC Javascript folder

New Here ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

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.

TOPICS
Acrobat SDK and JavaScript

Views

589

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 09, 2020 Aug 09, 2020

Copy link to clipboard

Copied

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" ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

The issue is they don't know where to put the .js file that contains it...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 10, 2020 Aug 10, 2020

Copy link to clipboard

Copied

The function works fine when I use it on my main Win10 device which I used to build the function. That machine has Adobe Acrobat Pro 2020. I already put copies of the .js file in both those directories you mentioned. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 11, 2020 Aug 11, 2020

Copy link to clipboard

Copied

LATEST

At the begin of the .js file add this line:

app.alert("test");

What happens when you start/run Acrobat Reader?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines