Hallo
Is it possible to include an image other than the "puzzle" design in a custom button?
I am working with PDF-XChange Editor plus Version 10.0.1 and the button is
created by Javascript
app.addToolButton({
cName: "Buchungsbeleg",
cExec: "Buchungsbeleg()",
cTooltext: "Beleg speichern",
cEnable: true,
cLabel: "EMR Beleg speichern",
nPos: 5
});
Thank you for your help. Peter
custom button with individual image
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
-
- User
- Posts: 7
- Joined: Sun Aug 06, 2023 7:41 pm
custom button with individual image
You do not have the required permissions to view the files attached to this post.
-
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: custom button with individual image
Hi Peter.
The standard way is described there:
https://opensource.adobe.com/dc-acrobat ... toolbutton
- unfortunately, that Adobe's manual is organized ugly so you need to search "addToolButton" on that web-page to reach the description and see this example:
Tip: in Editor you may load the icon much easier than in Acrobat, just via:
oIcon = util.iconStreamFromImage("/C/myIcon.jpg");
HTH.
The standard way is described there:
https://opensource.adobe.com/dc-acrobat ... toolbutton
- unfortunately, that Adobe's manual is organized ugly so you need to search "addToolButton" on that web-page to reach the description and see this example:
Code: Select all
// Create a document
var myDoc = app.newDoc();
// import icon (20x20 pixels) from the file specified
myDoc.importIcon("myIcon", "/C/myIcon.jpg", 0);
// convert the icon to a stream.
oIcon = util.iconStreamFromIcon(myDoc.getIcon("myIcon"));
// close the doc now that we have grabbed the icon stream
myDoc.closeDoc(true);
// add a toolbutton
app.addToolButton({
cName: "myToolButton",
oIcon: oIcon,
cExec: "app.alert('Someone pressed me!')",
cTooltext: "Push Me!",
cEnable: true,
nPos: 0
});
app.removeToolButton("myToolButton")
oIcon = util.iconStreamFromImage("/C/myIcon.jpg");
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Tracker Software Products
Project Developer
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.