Selected 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.
Post Reply
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Selected Pages

Post by jeffp »

[1]
How can I get all the selected pages from

TPXV_Control?

I can get the current page with

TPXV_Control.CurrentPage

But I don't see where I can get all the selected pages.

[2]
Also, in the old viewer SDK there was a way to change the color of the app workspace. Where is that found in the new SDK?

Thanks.

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

Re: Selected Pages

Post by Sasha - Tracker Dev Team »

Hello Jeff,

1) To get the Selected Pages you will have to get the pages selection from the needed document. You can do this by using this code:

Code: Select all

int nSel = pdfCtl.Inst.Str2ID("selection.pages");
PDFXEdit.IPXV_DocSelection docSel = pdfCtl.Doc.GetSel(nSel);
PDFXEdit.IPXV_PagesSelection ps = docSel as PDFXEdit.IPXV_PagesSelection;
if (ps != null)
{
	PDFXEdit.IPXV_PageIndexesList pagesList = ps.Items;
}
2) You mean you want to change the Theme programmatically?
Image

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Selected Pages

Post by jeffp »

Your selected pages code works great.

However, I'm getting an exception when I call

TPXV_Control.CurrentPage

Is there another way to get the current page of the active document?

And yes, I want to change the Theme programatically.

Thanks.

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

Re: Selected Pages

Post by Sasha - Tracker Dev Team »

Hello Jeff,

What kind of exception are you experiencing with the CurrentPage?
As for the theme, here's the link to the topic:
https://forum.pdf-xchange.com/ ... 66&t=27438

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Selected Pages

Post by jeffp »

The kind that crashes my program. Here are some lines from madExcept

005afe7a +07a FileCenter.exe System.Win.ComObj DispatchInvokeError
007a58d5 +061 FileCenter.exe Vcl.OleCtrls TOleControl.GetProperty
007a54bd +005 FileCenter.exe Vcl.OleCtrls TOleControl.GetIntegerProp
0097138c +044 FileCenter.exe PDFXEdit_SDK 5376 +3 TMyPDFControl.CurrentPage
012c5039 +029 FileCenter.exe ViewerTrackerFme 87 +1 TfmeTrackViewer.tbnTestClick

Looks like it is a broader issue. Calling

TPXV_Control.ZoomLevel

crashes as well.

Looks like it may be an issue with the Properties off of the TPXV_Control object.

Also, any way to customize the themes programatically? Looks like I would do something like

FControl.Inst.Settings['CustomUI.Colors'].Add(dt_Array).v := RGB(255, 255, 255);

But I'm not sure how to set the value in Delphi since it is a vt_Array type. The above doesn't seem to work.

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

Re: Selected Pages

Post by Sasha - Tracker Dev Team »

Hello Jeff,

As for the exceptions - there is a problem with the IPXV_Control interface in the TLB. Some properties are not valid when used in Delphi - we will need to investigate and fix that.

As for the color setting, there is a sample of doing that in the FullDemo application. The problem is that the structure of the CAB node is not a simple number as you've tried to add. Check this code in the FullDemo:

Code: Select all

// setup colors
   {
    PDFXEdit.ICabNode clrArr = pr["Colors"];
    SetCustColor(clrArr, "base", clr2str(btnFaceClr.BackColor));
    SetCustColor(clrArr, "window", clr2str(btnWndClr.BackColor));
    SetCustColor(clrArr, "text", clr2str(btnTextClr.BackColor));
    SetCustColor(clrArr, "selection", clr2str(btnSelClr.BackColor));
   }
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: Selected Pages

Post by jeffp »

Is there another way to get the CurrentPage?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Selected Pages

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Sure, the Control is just the interface used for easier SDK usage. Here's how the get_CurrentPage implemented inside of it:
FControl.Doc.ActiveView.PagesView.Layout.CurrentPage

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply