Page 1 of 1
add new option to menu save
Posted: Mon Sep 14, 2020 9:17 am
by jpgb
Is there a way to add a new option to menu save?
And capture the click event of that button?
Basically i want to do a personalized export function...
Thanks
JB
Re: add new option to menu save
Posted: Mon Sep 14, 2020 9:25 am
by jpgb
Sorry. Found it in a post!
JB
Re: add new option to menu save
Posted: Mon Sep 14, 2020 10:10 am
by jpgb
One problem: When i add the option, the icon doesnt show... the style is display:none
How can i avoid this?
var saveMenu = viewer.jsObject.controls.menus.saveMenu;
var customSaveItem = viewer.jsObject.VerticalMenuItem(saveMenu, "myItemName", "certificate", "certificate.png", "customItemKey");
saveMenu.innerContent.appendChild(customSaveItem);
customSaveItem.image.src = "........img/certificate.png"
Re: add new option to menu save
Posted: Mon Sep 14, 2020 7:12 pm
by Lech Kulikowski
Hello,
//if you need add image to item, for example:
viewer.jsObject.collections.images["customImageName"] = "
https://www.stimulsoft.com/templates/st ... es/usa.png";
var customSaveItem = viewer.jsObject.VerticalMenuItem(saveMenu, "itemName", "Item Text", "customImageName"/*or null*/ , "itemKey");
Thank you.