[]
Type representing a viewer's toolbar item.
var pdfExportButton: ToolbarItem = {
key: '$pdfExportButtonKey',
checked: true,
enabled: true,
iconCssClass: 'mdi mdi-file-pdf',
text: 'Export to PDF',
title: 'Export to PDF',
action: function(item) {
console.log('Export to PDF function works here');
},
onUpdate: function(arg, item) {
console.log('Something in viewer was updated, check/update button state here');
}
};
viewer.toolbar.desktop.addItem(pdfExportButton);
action: () => void;
Action handler for the toolbar item.
void
optional checked: boolean;
Shows whether the toolbar item is checked.
optional enabled: boolean;
Shows whether the toolbar item is enabled.
optional iconCssClass: string;
Specifies css class for the icon of the toolbar item.
key: string;
The uniq identifier of the toolbar item. See keys of the standard viewer's toolbar buttons here: [[ToolbarButtons]]
onUpdate: () => ToolbarItem;
The function called to update toolbar item state.
ToolbarItem
optional text: string;
Specifies the text of the toolbar item.
optional title: string;
Specifies the tooltip of the toolbar item.