Document Tab Sorting

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
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Document Tab Sorting

Post by DolphinMann »

Forgive me if this has been posted. I tried a search within the forums, sample code, and API documentation but could not find anything concrete.

How would one go about sorting the document tabs, in multi-document mode, pro grammatically in the Editor SDK? I found things on bookmarks and annotations, but nothing about the tabs themselves.

I know the users can drag and drop the tabs. What event is firing there? Can you please provide some guidance?

Edit: Another question I may as well bulk in here instead of a new thread:

I see that according to the following wiki: https://sdkhelp.pdf-xchange.com/vie ... PagesRange

If I want to only do something to selected pages of a document I should use:

Code: Select all

options["PagesRange.Type"].v = 7;
options["PagesRange.Array"].v = selectedPageNumbers;
my confusion is trying to figure out what "selectedPageNumbers" should be. This is in C#. I have tried

int[]
uint[]
string, in the format "1,2,3" for instance

It throws an exceptions for all of those. How would I pass only the selected pages to an operation command?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Document Tab Sorting

Post by Sasha - Tracker Dev Team »

Hello DolphinMann,

The ["PagesRange.Array"] is of the CAB array type, meaning that you should use the ["PagesRange.Array"].Add().v = n; to add the needed element.

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: Document Tab Sorting

Post by Sasha - Tracker Dev Team »

As for the tab position insertion, you can catch the https://sdkhelp.pdf-xchange.com/vie ... oreExecute event and see whether it's an Open Document operation https://sdkhelp.pdf-xchange.com/view/PXV:op_openDoc
Then if so, you should mark the event as handled, read the open parameters and execute the IPXV_MainFrame::OpenDocFrom /IPXV_MainFrame::OpenDocFromPath method with the needed https://sdkhelp.pdf-xchange.com/vie ... nDocParams specified ( the InsertBeforeTab parameter). Do not forget to set some bool that in this case the openDoc operation should execute normally.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Re: Document Tab Sorting

Post by DolphinMann »

Thank you for the responses!

Once they are open, is there a way to reorder them?

Edit:

I must still be doing something wrong. Even changed to .Add().v =n; it is still not accepting
int[]
uint[]
"1,2,3"

What would be the best way to get the currently selected pages for any Operation.Do command that takes PagesRange.Array?

I was using this, where returnValue is a List/Array of int's.

Code: Select all

                    int nSel = this.pdfEditor.Inst.Str2ID("selection.pages");
                    IPXV_PagesSelection ps = this.pdfEditor.Inst.ActiveDoc.GetSel(nSel) as PDFXEdit.IPXV_PagesSelection;
                    IPXV_PageIndexesList pagesList = ps.Items;

                    for (uint count = 0; count < pagesList.Count; count++)
                    {
                        returnValue.Add(pagesList[count]);
                    }
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Document Tab Sorting

Post by Sasha - Tracker Dev Team »

Hello DolphinMann,

We are planning to add a new panel that would contain all of the open documents and will allow to reorder them. if you can wait, that would be available in one of the nearest future builds.

As for the .Add().v - this adds a new element into the array. Each new element should be an int that represents the needed page number for example:

Code: Select all

["PagesRange.Array"].Add().v = 1;
["PagesRange.Array"].Add().v = 3;
["PagesRange.Array"].Add().v = 4;
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
DolphinMann
User
Posts: 158
Joined: Mon Aug 04, 2014 7:34 pm

Re: Document Tab Sorting

Post by DolphinMann »

The new version sounds great. I have a few open items that are waiting on versioning updates. Is there a way to keep informed of new release schedules or events?

And would it be possible, by any means with the current version, to move the order of tabs? I know users can drag and drop them so there must be a way, correct?
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17820
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Document Tab Sorting

Post by Tracker Supp-Stefan »

Hello DolphinMann,

The plan is for the next build to be released around the middle of next month.

As for the sorting of tabs - yes it's possible through the UI, but the needed methods are not currently available through the SDK.

Regards,
Stefan
Post Reply