Page Move Event

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
tembreull
User
Posts: 6
Joined: Tue Jun 21, 2016 8:18 pm

Page Move Event

Post by tembreull »

I'd like to be informed when a user moves pages, and I'd like to know which pages were moved and where to.
I'm guessing this can be achieved through the control's OnEvent handler, but I can't find any documentation on which event I need to be listening to and how to get the requisite information about the event.

Any help would be appreciated.

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

Re: Page Move Event

Post by Sasha - Tracker Dev Team »

Hello Scott,

The procedure should be the following:
1) You catch the e.operBeforeExecute event and from the e.pFrom you should get the IOperation. Then you'll need to check the operation's ID:

Code: Select all

int nID = Inst.Str2ID("op.document.movePages", false);
2) If it's the move operation then two events will be fired: e.document.beforeChangePagesList and e.document.afterChangePagesList. By listening to these events you can compare the pages you had with the pages you got as a result.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
stephen.starr
User
Posts: 123
Joined: Wed Mar 25, 2015 10:59 pm

Re: Page Move Event

Post by stephen.starr »

Regarding #1, how do I get the IOperation from the pFrom object? I am assuming I need to cast it somehow but can't find any documentation on it.

Thank you.
stephen.starr
User
Posts: 123
Joined: Wed Mar 25, 2015 10:59 pm

Re: Page Move Event

Post by stephen.starr »

Disregard, I guess I should have "tried" casting it. Works fine. Thank you.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Page Move Event

Post by Sasha - Tracker Dev Team »

Glad you've found an answer :wink:
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply