cmd.bp.sortPagesByBookmarks  SOLVED

PDF-XChange Editor SDK for Developers

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

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

cmd.bp.sortPagesByBookmarks

Post by jusWest »

Hello!

I am trying to run the command cmd.bp.sortPagesByBookmarks, to sort pages based on the order of the bookmarks.

I'm running it like this from code:

Code: Select all

                var cmd = uiInst.CmdManager.Cmds.Find("cmd.bp.sortPagesByBookmarks");

                if (cmd == null)
                    return false;

                _Inst.ExecUICmd2(cmd.ID);
but all I get when I run that is a pling, and nothing happens.

If I activate the ribbon toolbar and run it from the bookmark pane, it does work.

How can I run this from code?

I use version 8.0.336

Regards
Ronny
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

I upgraded the sdk to 8.0.343, but still only a pling when I try to run the command
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.bp.sortPagesByBookmarks

Post by Sasha - Tracker Dev Team »

Hello jusWest,

Have you loaded the BookmarksPlugin correctly?
viewtopic.php?f=66&t=26061&p=101599&hil ... bp#p101588

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

Yes I think so:

Code: Select all

            InitializeComponent();

            pdfCtl.SetLicKey(licKey);

            pdfCtl.Inst.Settings["General.AppTitle"].v = "TestSDK ";
            pdfCtl.Inst.Settings["Commenting.ShowTooltips"].v = false;
            pdfCtl.Inst.Settings["Misc.ShowMsgNoOfficeLicense"].v = false;

            pdfCtl.Inst.StartLoadingPlugins();

            var pluginsPathX86 = AppDomain.CurrentDomain.BaseDirectory + @"Plugins.x86\";
            pdfCtl.Inst.AddPluginFromFile(pluginsPathX86 + "Bookmarks.pvp");

            pdfCtl.Inst.FinishLoadingPlugins();
And the command is available in the Bookmark pane off the ribbon, and works from there:
bmpluginenabled.PNG
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

I also tried it this way, same result:

Code: Select all

            PXV_Inst Inst = new PXV_Inst();

            Inst.Init(null, licKey);

            Inst.StartLoadingPlugins();

            var pluginsPathX86 = AppDomain.CurrentDomain.BaseDirectory + @"Plugins.x86\";
            Inst.AddPluginFromFile(pluginsPathX86 + "Bookmarks.pvp");

            Inst.FinishLoadingPlugins();

            InitializeComponent();
Its just weird, I get a "pling", like when you use a noen existant keyboard shortcut, no error.

And cmd.ID returns a value, so I guess the command exists...
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

Can I send a test project so you can see if I do things correctly?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.bp.sortPagesByBookmarks

Post by Sasha - Tracker Dev Team »

Hello jusWest,

Of course - that would be the best action. Note that you should not include any dev keys there.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

Sasha - Tracker Dev Team wrote: Fri Mar 19, 2021 8:33 am Hello jusWest,

Of course - that would be the best action. Note that you should not include any dev keys there.

Cheers,
Alex
Thank you, attached is a testproject that has this behaviour.

Keep in mind, this is SDK version: 8.0.343.0
TestSDKUpgrade.zip
(16.33 KiB) Downloaded 61 times
Regards
Ronny
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

Sasha - Tracker Dev Team wrote: Fri Mar 19, 2021 8:33 am Hello jusWest,

Of course - that would be the best action. Note that you should not include any dev keys there.

Cheers,
Alex
Did you get a chance to look at it?

/Ronny
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.bp.sortPagesByBookmarks

Post by Sasha - Tracker Dev Team »

Hello jusWest,

Yup, everything worked for me.
Please doublecheck whether you are opening a document that contains several bookmarks and several pages and that you have the rights to do that operation.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: cmd.bp.sortPagesByBookmarks

Post by Sasha - Tracker Dev Team »

Hello jusWest,

Also, can you please try doing that with the latest version of the SDK?

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

Sasha - Tracker Dev Team wrote: Mon Mar 22, 2021 7:47 am Hello jusWest,

Yup, everything worked for me.
Please doublecheck whether you are opening a document that contains several bookmarks and several pages and that you have the rights to do that operation.

Cheers,
Alex
Weird, I have all rights on the dokuments I test with, and can do all other changes to the documents, it has atleast 50 bookmarks in
the documents I test.

As said, this action works if I use the finction via the bookmark ribbon menu, but not when I use the button below the editor.
You did try that button?
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks

Post by jusWest »

Sasha - Tracker Dev Team wrote: Mon Mar 22, 2021 7:52 am Hello jusWest,

Also, can you please try doing that with the latest version of the SDK?

Cheers,
Alex
I can try that yes :)
jusWest
User
Posts: 150
Joined: Fri Aug 24, 2018 8:26 am

Re: cmd.bp.sortPagesByBookmarks  SOLVED

Post by jusWest »

jusWest wrote: Mon Mar 22, 2021 8:21 am
Sasha - Tracker Dev Team wrote: Mon Mar 22, 2021 7:52 am Hello jusWest,

Also, can you please try doing that with the latest version of the SDK?

Cheers,
Alex
I can try that yes :)
AAAND of course that works in the testproject :shock:

I have delayed the upgrade because our main project is quite large, but now it seems I have to bite the bullet :)
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

cmd.bp.sortPagesByBookmarks

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply