user5
October 22, 2021, 3:22pm
1
Which product are you using?
PDF.js Express Plus
PDF.js Express Version
8.0.1
Detailed description of issue
Is it possible to add a custom button to the Menu? (the one that has the full-screen, dark mode, and print links)
We’re only able to add a custom button to the main bar so far.
Thank you.
Logan
October 25, 2021, 3:18pm
2
Hey! This code should do the trick:
instance.UI.settingsMenuOverlay.add({
type: 'actionButton',
className:"row",
img: 'IMG_SRC_HERE',
onClick: () => {
// action here
},
dataElement: 'UNIQUE ID HERE',
label:'Button Label'
});
If you want to change the order of the items, you can call getItems, then rearrange the array how you wish, then pass the new array to update
Thanks,
Logan
user5
October 25, 2021, 6:23pm
3
Thanks @Logan it worked, that was exactly what we were looking for.
Thanks again!