These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

add a button that already exist in a toolbar

chaida
Registered: Sep 9 2008
Posts: 34
Answered

Hi,

I want to create a toolbar with javascript. I would like to know if it's possible to add a button that already define in Acrobat like printing in my toolbar?

Thank you for help
Chaida

My Product Information:
Acrobat Standard 9.0, Windows
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
You're going to have to be more specific about what you want the button to do. You can use JavaScript code in a folder-level JavaScript file to set up a button that executes JavaScript code when clicked. So if what you want the button to do can be done with JavaScript, then the answer is yes. For example, you can use JavaScript to print, so you could set up a custom Print toolbar button.

George
chaida
Registered: Sep 9 2008
Posts: 34
What I was asking for is is it possible to create a toolbar that and add an existing button that acrobat has develops it like the save button or the print button.

Do I have to add a button with the same icon and specify by code the action I wan like a save or print?

In MS Word, you can create a toolbar and copy an existant button and add it to the customize toolbar, I was wondering if Acrobat does the same.

Thank you
chaida
Registered: Sep 9 2008
Posts: 34
I figure out that there is no way to add an acrobat toolbar button in the add-on toolbar.

However, I'm wondering if it's possible to execute a toolbar button with javascript. I want to press the button that add a sticky note without clicking on it.
George_Johnson
Online
Expert
Registered: Jul 6 2008
Posts: 1876
You can sometimes use JavaScript to duplicate what a regular toolbar button does, and adding annotations (comments) is something you can do. Thom Parker wrote a nice article here that shows you how to use JavaScript to add comments:

http://www.acrobatusers.com/tutorials/2007/10/auto_placement_annotations/

You can also use JavaScript to execute menu items, though many are restricted, but the restriction can be worked-around. There is a menu item for adding a sticky note, but there's no control over placement or other properties.

George
chaida
Registered: Sep 9 2008
Posts: 34
I'm so new to acrobat javascript that I forgot this function : app.execMenuItem
Now I have all I need to do what I want.

Thank you again for your help!