I've now managed to add two buttons to the "Home" tab. However, I have problems with a custom icon.
When I load a utitl.iconStreamFromIcon no buttons are created for me.
However, if I use the icon ID, everything works.
I saved my icon in the .../Icon/icostubIcon.png directory.
Does anyone have an idea what I'm doing wrong here?
Here my code:
Code: Select all
//Fullpath: C:\Users\ama\AppData\Roaming\Tracker Software\PDFXEditor\3.0\JavaScripts\Icon\icostubIcon.png
var myDoc = app.newDoc();
myDoc.importIcon("stubIcon", "/Icon/icostubIcon.png", 0);
var oIcon = util.iconStreamFromIcon(myDoc.getIcon("stubIcon"));
myDoc.closeDoc(true);
//var cIconID = "ico.pencil";
app.addSubMenu({ cName: "myRbTools", cUser: "My Ribbon Tools", cParent: "-", cRbParent: "Home", bNewRbGroup: true, nRbGroupStyle: 2 });
var id = "1";
app.addMenuItem( {
cName: "feature" + id,
cUser: "alle Stempel drucken",
cParent: "myMenu",
cRbParent: "myRbTools",
oIcon: oIcon,
//cIconID: cIconID,
cExec: "SetAllPrintableStamp()" }
);
var id = "2";
app.addMenuItem( {
cName: "feature" + id,
cUser: "markierte Stempel drucken",
cParent: "myMenu",
cRbParent: "myRbTools",
oIcon: oIcon,
//cIconID: cIconID,
cExec: "SetSelectPrintableStamp()" }
);
function SetAllPrintableStamp() {
this.syncAnnotScan();
var annots = this.getAnnots();
if (annots!=null && annots.length!=0)
for (var i in annots)
if (annots[i].print) {annots[i].print=false} else { annots[i].print=true};
}
function SetSelectPrintableStamp () {
var annots = this.selectedAnnots;
for (var i=0; i < annots.length; i++)
if (annots[i].print) {annots[i].print=false} else { annots[i].print=true};
}