Delete pages

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.
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Delete pages

Post by anovy »

Hi,

On https://sdkhelp.pdf-xchange.com/vie ... eletePages is stated that the "op.document.deletePages" operation uses IPXC_Document interface, in the example is used IPXV_Document interface. After testing I found that it works with both interfaces, so maybe you should mention this here.

And I have question about IPXC_Document::Pages.DeletePage() function:
If I use it, then the parent IPXV_Document interface does not know about this change and the pages view is in incorrect state (the deleted pages are still in view, but not drawn). So what must be performed with the parent IPXV_Document interface to correct this?

BTW:
The SDK documentation (https://sdkhelp.pdf-xchange.com/vie ... eletePages) says that the input IBitSet should contain the indexes of pages. However IBitSet is array of bool values, page indexes cannot be stored here, I found that I should make IBitSet of PagesCount size and set TRUE those IBitSet items, whose indexes conforms to the deleted pages.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Delete pages

Post by Sasha - Tracker Dev Team »

Hello anovy,

The thing is the the IPXV_Document holds the IPXC_Document inside in the native code. Thus you can pass either of them as the input - our native code will automatically use the IPXC_Document from the IPXV_Document.

As for the Core Level methods. If you are using them, then you will have to do all of the stuff that's being done by the operation manually (event sending, undo\redo data etc.). The events are used to "tell" the UI that something happened on the core level. The e.document.beforeChangePagesList and e.document.afterChangePagesList events are used in this case.

About the BitSet - you've understood correctly - each of the IBitSet element represent whether the page should be removed or not.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
anovy
User
Posts: 164
Joined: Mon Feb 08, 2010 8:48 am

Re: Delete pages

Post by anovy »

Hi,

So I'm using "op.document.deletePages" instead (with OpExecFlag_NoUI|OpExecFlag_ForceNonUndo|OpExecFlag_NoProgress). It works good.

Thank you.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: Delete pages

Post by Sasha - Tracker Dev Team »

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