Highlighted

Custom button changes to another using Javascript in Acrobat Pro

Explorer ,
Jun 20, 2020

Copy link to clipboard

Copied

Hi all,

I want to write a folder level script that has a customized toolbar button in Acrobat Pro. I am able to do it using app.addToolButton() by setting the 'oIcon' parameter. Now I want this button to change to another button ( with a different hex string) on clicking it. I checked the documentation but could not find it to add a different button at run time. Is this possible? 

Thanks for the help in advance.

 

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Not possible.

Topics

Acrobat SDK and JavaScript

Views

86

Likes

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

Custom button changes to another using Javascript in Acrobat Pro

Explorer ,
Jun 20, 2020

Copy link to clipboard

Copied

Hi all,

I want to write a folder level script that has a customized toolbar button in Acrobat Pro. I am able to do it using app.addToolButton() by setting the 'oIcon' parameter. Now I want this button to change to another button ( with a different hex string) on clicking it. I checked the documentation but could not find it to add a different button at run time. Is this possible? 

Thanks for the help in advance.

 

Adobe Community Professional
Correct answer by Bernd Alheit | Adobe Community Professional

Not possible.

Topics

Acrobat SDK and JavaScript

Views

87

Likes

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
Jun 20, 2020 1
Adobe Community Professional ,
Jun 20, 2020

Copy link to clipboard

Copied

Not possible.

Likes

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
Reply
Loading...
Jun 20, 2020 2
Explorer ,
Jun 20, 2020

Copy link to clipboard

Copied

Thanks a lot!

Likes

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
Reply
Loading...
Jun 20, 2020 1
try67 LATEST
Most Valuable Participant ,
Jun 20, 2020

Copy link to clipboard

Copied

Only way I can think of being able to do it is to use the removeToolButton command to remove the original one and then call addToolButton again with the new icon (and a new ID, most likely). However, as per the documentation, you have to call removeToolButton from the same context as the original call to addToolButton, so that means that you will have to first close all files, then call it, then add the new button. In short, I don't think it's worth the effort just to get a display a new icon...

Likes

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
Reply
Loading...
Jun 20, 2020 2