Does app.addToolButton still works? (not at my side)  SOLVED

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
bernard meunier
User
Posts: 120
Joined: Tue May 06, 2014 7:52 pm

Does app.addToolButton still works? (not at my side)

Post by bernard meunier »

Hi,
In the past I did use a custom script to add button to PDFEditor.
Script "ReverseOrder.js" was stored in %appdata%\Tracker Software\PDFXEditor\3.0\JavaScripts\ folder
Is that still supported? (I didn't see any added button)
Regards
Bernard

Script content :
function ReversePageOrder()
{
for (i = this.numPages - 1; i >= 0; i--) this.movePage(i);
}

app.addToolButton({
cName: "Reverse Page Order",
cExec: "ReversePageOrder()",
cTooltext: "Reverse pages",
cEnable: true,
nPos: 0
});
bernard meunier
User
Posts: 120
Joined: Tue May 06, 2014 7:52 pm

Re: Does app.addToolButton still works? (not at my side)  SOLVED

Post by bernard meunier »

Hi,

I did make some more investigations and it looks like the JavaScripts folder should be directly under PDF installation folder instead of being in a "3.0" folder.

Therefore for portable version right place for the Javascripts.js is:
...\PDFXEdit8_Portable\JavaScripts\

Upon launching, this add a "Add-on Tools" menu at right of Help Menu.
Button icon look like generic module button. However the cTooltext: "Reverse pages" from my script is well displayed when moving mouse over it.

Thanks for making this as solution ;-)
bernard meunier
User
Posts: 120
Joined: Tue May 06, 2014 7:52 pm

Re: Does app.addToolButton still works? (not at my side)

Post by bernard meunier »

I did add a Label name so that to avoid confusion when having many add-on buttons.

Here is new script with the cLabel addition:

function ReversePageOrder()
{
for (i = this.numPages - 1; i >= 0; i--) this.movePage(i);
}

app.addToolButton({
cName: "Reverse Page Order",
cExec: "ReversePageOrder()",
cTooltext: "Reverse pages",
cEnable: true,
nPos: 0,
cLabel: "Reverse pages"
});
User avatar
Ovg
User
Posts: 461
Joined: Tue Sep 05, 2017 4:56 pm

Re: Does app.addToolButton still works? (not at my side)

Post by Ovg »

You can add icon to your button ....
eg:

oIcon: util.iconStreamFromImage("/c/Users/User/Documents/Icons/file.ico"),
It's impossible to lead us astray for we don't care even to choose the way.
PDF-XChange PRO, 10.1.1 (Build 381) / W7 SP1 x64
User avatar
Dimitar - Tracker Supp
Site Admin
Posts: 1797
Joined: Mon Jan 15, 2018 9:01 am

Does app.addToolButton still works? (not at my side)

Post by Dimitar - Tracker Supp »

:)
Post Reply