Customize toolbar with javascript

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
ng80092a
User
Posts: 21
Joined: Thu May 13, 2021 11:50 am

Customize toolbar with javascript

Post by ng80092a »

Dear,

I'm able to successfully add icons on the "Add-on Tools" menu, but I have plenty of them and to organize I'd need to create an additional menu (1) and place some icons there, use a separator (2), or possibly add a icon with more suboptions in a list (3).
All of this in javascript if possible of course.
image.png
I've already tried app.addSubMenu({ cName: "New", cParent: "File", nPos: 1 })
But if I change the cParent to "Home" it doesn't go to the Home menu.

Other test was to create app.addMenuItem({ cName: "Letter222", cParent: "New", cExec: somefunction(); })
But this also went under the File menu, and not under the "New" button

Please let me know if I can fix this code.

Kind regards,

Edit:
Also, is there a list of the app.add functions? There are some in the acrobat menu, but I couldn't make use of them in pdf x-change
User avatar
TrackerSupp-Daniel
Site Admin
Posts: 8371
Joined: Wed Jan 03, 2018 6:52 pm

Re: Customize toolbar with javascript

Post by TrackerSupp-Daniel »

Hello, ng80092a

There is currently no way to do what you are asking for here, you will need to create the buttons normally in the "add on tools" menu, and then move them to a new location via the "customize UI" menu. I am just double checking with our dev team about the possibility of a JS "flyout" button, but I do not think that is possible either. If it turns out I am incorrect I will followup here to let you know.

As for a list of the "app.add" functions, the Adobe JS api manual is the most complete resource for that, though not all functions that they list are supported in our software: http://dev.datalogics.com/cookbook/docu ... erence.pdf

Kind regards,
Dan McIntyre - Support Technician
Tracker Software Products (Canada) LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
ng80092a
User
Posts: 21
Joined: Thu May 13, 2021 11:50 am

Re: Customize toolbar with javascript

Post by ng80092a »

Thank you Daniel,

Is it then possible to save a new Ribbon tab in an external file, and load it in another computer, with the same shortcuts?

Kind regards
ng80092a
User
Posts: 21
Joined: Thu May 13, 2021 11:50 am

Re: Customize toolbar with javascript

Post by ng80092a »

Bump
Willy Van Nuffel
User
Posts: 2342
Joined: Wed Jan 18, 2006 12:10 pm

Re: Customize toolbar with javascript

Post by Willy Van Nuffel »

This should be possible in the following way:
- File > Manage Settings > Export Settings
- Only mark the "Common" check-box (seems to be sufficient for ribbon and toolbar customizations)
- Click OK and save the "PDFXChangeEditorSettings.xces" file to a folder where you have write access
You can also save it on a memory-stick, or a network drive if you like.

Now, on the other computer, do the reverse way:
- File > Manage Settings > Import Settings
- Select the "PDFXChangeEditorSettings.xces" file and click "Open"
- You will see that you only have Program Options > Common available
- Click OK

TAKE CARE: Existing ribbon-customizations on the second computer will be removed when importing the *.xces file.
To avoid loss of previous customizations, you can run an "export settings" on this one, before importing the new settings.

NOTE: I am not aware of a possibility to 'merge' two or more different customizations of the same kind (in this case "ribbon"-customizations).
Attachments
PDF-XChange Editor - Export Settings.png
PDF-XChange Editor - Export Settings.png (42.52 KiB) Viewed 676 times
User avatar
Paul - Tracker Supp
Site Admin
Posts: 6813
Joined: Wed Mar 25, 2009 10:37 pm
Location: Chemainus, Canada
Contact:

Re: Customize toolbar with javascript

Post by Paul - Tracker Supp »

Thanks for that Willy,

I do believe that is the right approach. We do not offer any different specific mechanism to do this.

ng80092a - I am keen to hear how this goes.
Best regards

Paul O'Rorke
Tracker Support North America
http://www.tracker-software.com
ng80092a
User
Posts: 21
Joined: Thu May 13, 2021 11:50 am

Re: Customize toolbar with javascript

Post by ng80092a »

Thanks, but the idea is to install it in automatically, as a distribution template. I've noticed the registry holds a few keys that do this and can do it, but is this documented anywhere?

Kind regards.
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17765
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Customize toolbar with javascript

Post by Tracker Supp-Stefan »

Hello ng80092a,

If you are considering pushing the settings through the registry to many users - that is indeed possible.
We have a section of our help/manuals dedicated to sysadmins:
https://help.pdf-xchange.com/sysadmin/
And this particular page shows where settings are stored, and you can copy and distribute them by copying the relevant registry tree:
https://help.pdf-xchange.com/sysad ... hacks.html

Kind regards,
Stefan
Post Reply