DocuVieware Reference Guide
Reference Guides > JavaScript API > Actions > Interface > AddAnnotationsActionButton

This function allows you to add a custom item to the selected annotation action buttons list.

AddAnnotationsActionButton: function (docuViewareID, caption, icon, callback)


The identifier for the DocuVieware™ instance you want to add an annotation action custom button to.
A string that represent the text that will be displayed as tooltip.
A string that contains the SVG markup for the icon that will be displayed.
A function that will be executed when the user clicks on the button.
It provides an argument with the following prototype: { id } which is the selected annotation identifier.

Example of usage

This code adds a star button to the annotation action button list that displays the selected annotation identifier in the console.

      "<svg width='100%' height='100%' viewBox='0 0 16 16'><path d='M16 6.204l-5.528-0.803-2.472-5.009-2.472 5.009-5.528 0.803 4 3.899-0.944 5.505 4.944-2.599 4.944 2.599-0.944-5.505 4-3.899z'></path></svg>",
      function (annot) { console.log( });

Return Value

1 if error, 0 if success.