PXC_Rect - Points to Millimeters + any ready made methods to deflate it?  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

PXC_Rect - Points to Millimeters + any ready made methods to deflate it?

Post by zarkogajic »

Hi Support,

I need to deflate an PXC_Rect returned by IPXC_Page.Box(PBox_PageBox) by some millimeters.

For, example, for an A4 sized page the PXC_Rect.Top will be 842 points (297 mm) and .Right will be 595 points (210 mm).

[Q] Are there any ready made methods to deflate an PXC_Rect by some millimeters?

I need to go from:
.Left = 0
.Top = 842
.Bottom = 0
.Right = 595

to (deflate by 102 points - actually 36 millimeters):
.Left = 102
.Top = 740
.Bottom = 102
.Right = 493

p.s.
I see various methods exposed by MathHelper - but cannot find what I'm up to ...

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

Re: PXC_Rect - Points to Millimeters + any ready made methods to deflate it?

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

We have the IPXV_Inst::GetMeasureUnitInfo method available.

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

Re: PXC_Rect - Points to Millimeters + any ready made methods to deflate it?

Post by zarkogajic »

Hi Alex,

Thank for this, but does not apply for my question :)

I know what number of points are in 1 mm / inch, etc..

I'm looking for some pre-made methods to do PXC_Rect manipulation (like deflate) - maybe via some Matrix manipulation or something? Or, maybe something like that does not exist out of the box - that's also ok....

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

Re: PXC_Rect - Points to Millimeters + any ready made methods to deflate it?

Post by Sasha - Tracker Dev Team »

Hello zarkogajic,

Sadly, we did not include our rectangle classes functionality, as these are pretty straightforward (unlike matrices). So you will have to write the needed methods for yourself, if you have many usage cases.

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

Re: PXC_Rect - Points to Millimeters + any ready made methods to deflate it?  SOLVED

Post by zarkogajic »

Hi Alex,

OK, thanks, noted.

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

PXC_Rect - Points to Millimeters + any ready made methods to deflate it?

Post by Sasha - Tracker Dev Team »

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