I've written some custom scripts for Adobe Acrobat Pro (I work with a lot of PDFs for scientific research) and they run just fine on Mac and Windows. Linux only has Adobe Reader, but I still managed to get the menu items displaying within the file menu at startup, as shown in the screenshot of the Readme file at https://github.com/lmmx/CropScience (on Windows).
Since there is no mention of Linux in the Acrobat docs (presumably since only Reader is available rather than full Acrobat) I'm a little at a loss where to put my files to allow them the adequate permissions to run (when clicked).
A sample script, "CropPrintNature.js" corresponding to the settings for academic journal Nature:
app.addMenuItem({cName:"Crop for Nature (articles and ed.)",cParent:"Crop and Print", cExec:"for(var p=0;p<n();p++){o=a().getPageBox('BBox',p);o[0]+=34;o[1]-=37;o[2]-=33;o[3]+=22;if(p==0){o[1]-=38}for(b=0;b<4;b++){a().setPageBoxes(d[b],p,p,o)}};this.print();"});
I moved them from /opt/Adobe/Reader9/Reader/Javascripts to ~/.adobe/Acrobat/9.0/Javascripts and still doesn't work (but I think this should be the right location since it's user-specific not system-wide.
Within this latter folder, glob.js is empty and glob.settings.js just contains ��({})
I'd take a guess that there isn't any TypeError - I can see the Crop and Print button which should correspond to a cParent element referenced on clicking one of the buttons - rather there's an attempt to access something outside of its level of privilege as the last message (which logs to console when a button is clicked).
Do I need to move them, or add some config file...? The end of the console log is as follows:
App.addMenuItem:1:Folder-Level:User:CropPrintAnnuRev.js
===> Parameter cParent.
TypeError: Invalid argument type.
App.addMenuItem:1:Folder-Level:User:CropPrintBriefBioinfo.js
===> Parameter cParent.
TypeError: Invalid argument type.
App.addMenuItem:1:Folder-Level:User:CropPrintJMolBioEarly.js
===> Parameter cParent.
TypeError: Invalid argument type.
App.addMenuItem:1:Folder-Level:User:CropPrintAAutoBoundaries.js
===> Parameter cParent.
NotAllowedError: Security settings prevent access to this property or method.
Doc.setPageBoxes:1:Menu Crop for Nature Rev. Mol. Cell. Bio.:Exec