IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page  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
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page

Post by zarkogajic »

Hi Support,

Having an IPXC_Annotation I can use IPXV_AnnotSelection with EnsureVisible to "navigate to where the annotation is".

What if I only have a page index and a PXC_Rect - how to mimic what the IPXV_AnnotSelection does (the Show method)?

I though IPXV_PageRectSelection would do the trick - but it seems I cannot set anything (page and rect) from it.



p.s.
I can use IPXV_PagesLayoutManager.ZoomToPageRect (storing the current zoom, and applying back after) - but I'd like a selection rectangle to be visible.

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

Re: IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

The PageRectSelection is used in the Crop Tool, Snapshot Tool, Add Image tool and Add Barcode tool (basically the selected rectangle on the Pages View).
This can be used to navigate to any type of the destination that you need:
https://sdkhelp.pdf-xchange.com/vi ... estination

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page

Post by zarkogajic »

Hi Alex,

Thanks. This seems to do the same as the mentioned ZoomToPageRect.

What about the visual part of "selection"?

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

Re: IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

A screenshot of what you are trying to achieve would be preferable.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page

Post by zarkogajic »

Hi Alex,

I'm trying to mimic what 'selection.annots' does with IPXV_AnnotSelection's Show and EnsureVisible methods BUT without having the actual annotation to insert into ActiveSel - I only have the PXC_Rect.

For example, "Goto page 2" is a real link type annotation:

image.png
image.png (23.27 KiB) Viewed 1648 times

If I only have the rectangle I want to somehow "highlight" that portion of the page - like the rectangle to the right on the above image (done as explained below).

I thought I could use PageRectSelection for this - but no, as you said.

What I am doing right now - and please confirm nothing will hit me from the back at some later stage:

1. Insert new annot to page via Doc.CoreDoc.InsertNewAnnot(0 as insert position)
2. Use the newly created annot with IPXV_AnnotSelection and make it ActiveSel (+ Show / EnsureVisible)
3. Doc.CoreDoc.RemoveAnnots(0,1)

This works - and you can see the rectangle to the right - it is created in the above way.

Any better approach?


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

Re: IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page  SOLVED

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Well that is not a correct way of doing that as that is an issue that we are aware of and you are exploiting it's behavior. It will be fixed some day and you won't be able to do that anymore.
The best and correct way for you would be to draw your custom rectangle on the PagesView:
viewtopic.php?f=66&t=29167&p=113820&hil ... ck#p113820



Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page

Post by zarkogajic »

Hi Alex,

Ok, thanks, noted.

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

Re: IPXV_PageRectSelection - how to set it / how to navigate + highlight to an arbitrary rect on a page

Post by Sasha - Tracker Dev Team »

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