Custom tools/icons in toolbars in submenus

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

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

HQue
User
Posts: 16
Joined: Fri Mar 14, 2025 2:34 pm

Custom tools/icons in toolbars in submenus

Post by HQue »

Hello there, ,

could someone tell me what I would have to change in cParent and cRbParent in addSubMenu() and addMenuItem() in a custom tool in order to get my icon/tool displayed here:
Format - Text Editing Tools
image.png

Code: Select all

app.addSubMenu({ cName: "symbolsTR", cUser: "Alpha", cParent: "-", cRbParent: "Format", bNewRbGroup: true, nRbGroupStyle: 2 });

app.addMenuItem( {
	cName: "alpha",
	cUser: "Alpha",
	oIcon: alphaIcon,
	cTooltext: "",
        cParent: "Format",
        cRbParent: "rbar.format.properties", // add to comment tools on home ribbon
	cEnable: "event.rc = (this.selectedAnnots?.length)",
	cExec: "executeAlphaFct(this)"
});

Thanks in advance!

Niklas
You do not have the required permissions to view the files attached to this post.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11036
Joined: Wed Jan 03, 2018 6:52 pm

Re: Custom tools/icons in toolbars in submenus

Post by Daniel - PDF-XChange »

Hello, HQue

I am unsure if this is possible, given the context sensitivity of the Format ribbons, and their lack of presence when the corresponding tools are not in use... I have asked the Dev team for details on if and how this is possible, and will let you know as soon as I have heard back from them.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
HQue
User
Posts: 16
Joined: Fri Mar 14, 2025 2:34 pm

Re: Custom tools/icons in toolbars in submenus

Post by HQue »

That would be great, thank you!!
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11036
Joined: Wed Jan 03, 2018 6:52 pm

Re: Custom tools/icons in toolbars in submenus

Post by Daniel - PDF-XChange »

Hello, HQue

I am sorry to say that they have confirmed this. At the moment there is no way to define the dynamic "Format" tabs, as a target for JS button placement. You will need to use a different, "static" Ribbon tab to store those buttons.

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
HQue
User
Posts: 16
Joined: Fri Mar 14, 2025 2:34 pm

Re: Custom tools/icons in toolbars in submenus

Post by HQue »

Okay, that's a pitty but thanks a lot for the answer and the time for investigating!
User avatar
Jordan - PDF XChange
Site Admin
Posts: 254
Joined: Mon Jul 03, 2023 3:10 pm

Custom tools/icons in toolbars in submenus

Post by Jordan - PDF XChange »

:)
Best regards,
Jordan
HQue
User
Posts: 16
Joined: Fri Mar 14, 2025 2:34 pm

Re: Custom tools/icons in toolbars in submenus

Post by HQue »

Hello Daniel, hello Jordan

I would have another question related to the placements of menus.
I want to have my custom dynamic stamp tool placed next to the standard stamp icon with these seperator lines and as a large icon.
image.png

How can I do that?

So far my code looks like this:

Code: Select all

// This adds a menu item
app.addSubMenu({ cName: "addTools", cUser: "Add-in Tools", cParent: "Tools", nPos: 0, cRbParent:"-" });
app.addMenuItem({
    cName: "stamp",
    cUser: ("Stamp", 'Dynamischer Stempel'),
    cTooltext: ("Add stamp", 'Dynamischer Stempel'),
    cParent: "parents",
    cRbParent: "rbar.home.comment", // add to comment tools on home ribbon
    cEnable: true,
    cExec: "executeStampFct(this)",
    oIcon: stampIconLarge,
});

But I can not find any ressources on how to get:
- seperator lines
- large icons
- positioning

Any help on this one would be great!!
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19868
Joined: Mon Jan 12, 2009 8:07 am

Re: Custom tools/icons in toolbars in submenus

Post by Stefan - PDF-XChange »

Hello HQue,

You can enter the customize toolbar mode (right click any toolbar area and select the last option in the drop down menu), and you should then be able to move your icon from the "Add on tools" tab to any of the other tabs.

I do not believe you can do it via JS code directly through, but it is possible with the UI.

Kind regards,
Stefan
HQue
User
Posts: 16
Joined: Fri Mar 14, 2025 2:34 pm

Re: Custom tools/icons in toolbars in submenus

Post by HQue »

Hi Stefan,
Thanks for your answer.

I would be quite surprised if there were no possibility to control this JavaScript.
The big advantage would be that if we share the tool in the office, everyone would already have it in the correct location.