Skip to main content
Participating Frequently
May 29, 2020
Answered

JavaScript automation to add add-on tool to the toolbar

  • May 29, 2020
  • 1 reply
  • 1330 views

Hello everyone,

 

I am a complete beginner in developing Acrobat functionalities, and I had been given a task of adding a button to the toolbar, which on pressing would display a pop-up, using Javascript. I was able to add a button to the add-on toolbar and then I manually added the button from the add-on tools to the toolbar. I have been asked if this manual addition could be automated, I went through the Javascript API reference and found that it provides the execMenuItem method but it only is able to perform some commands such as Save As. Could it be possible to write a script that would automate the manual addition ? The manual addition that I am talking about is Going to View -> Show/Hide -> Toolbar Items -> Customize Quick Tools

 

 

I am aware that we can add a button to the toolbar directly using plugins but that would require developing in C++, and our team is trying to explore functionalities that could be achieved using JS scripts

 

Thanks

Correct answer Thom Parker

Unfortunately there is no way to add a button to the QuickTools bar with JavaScript. I don't even think it could be done with a plug-in.  The QuickTools buttons are stored in JSON format in a UserPrefs file named "UserPrefs_Acrobat.txt", along with many other user preferences.  These are loaded when Acrobat starts up and saved when Acrobat shuts down. 

 

1 reply

Thom Parker
Thom ParkerCorrect answer
Community Expert
May 29, 2020

Unfortunately there is no way to add a button to the QuickTools bar with JavaScript. I don't even think it could be done with a plug-in.  The QuickTools buttons are stored in JSON format in a UserPrefs file named "UserPrefs_Acrobat.txt", along with many other user preferences.  These are loaded when Acrobat starts up and saved when Acrobat shuts down. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often