Set button icon using javascript

How to set an icon of a button?
For example, how to set the icon of a button named 0015 to "c:\images\dummy.jpg"?
I might need to change the button to "Icon only" prior to that.
twowheelAsked:
Who is Participating?
 
Karl Heinz KremerCommented:
Oops - Update: I just realized that you want to do this with JavaScript

To do that you (as you correctly suggest) will have to change the layout mode first using the "buttonPosition" property of your field. See here for more information:

http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat11_HTMLHelp&file=JS_API_AcroJS.89.694.html

To import the image, you would use buttonImportIcon():

http://help.adobe.com/livedocs/acrobat_sdk/11/Acrobat11_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat11_HTMLHelp&file=JS_API_AcroJS.89.744.html

If you want to specify a path, there are security implications: You can only do that during a batch or a console event.
0
 
Karl Heinz KremerCommented:
You open up the button properties dialog, then go to the "Options" tab:

Button Properties - Icon
You can now select one of the layout options that uses an icon, once that is done, the "Choose Icon..." button will become available, and you can navigate to your icon file.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.