OpenDocumentFromFile nFlags  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
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

OpenDocumentFromFile nFlags

Post by jeffp »

Can you tell me where to find the available nFlags for

IPXC_Inst.OpenDocumentFromFile()

I need to make sure there is NoProgross and NoUI popping up when the file is opened.

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

Re: OpenDocumentFromFile nFlags

Post by Sasha - Tracker Dev Team »

Hello Jeff,

The Core level does not show any UI stuff like progress etc. As I expect, you are referring to the sample that I sent you earlier. If so, then what you really need is to set the flags of the IPXV_MainFrame::OpenDocFrom method. Here's how you should set them:
https://sdkhelp.pdf-xchange.com/vie ... nDocParams

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

Re: OpenDocumentFromFile nFlags

Post by jeffp »

Ok. What about this one in the Editor layer. I want to close a document opened in the Editor but skip any dialog that would appear if the document was modified. That is, skip the "Do you want to save changes dialog".

Is there a value for nFlags in this case? Also, is this the right way to close a document from the Editor programatically?

nFlags := 0;
FControl.Frame.View.DocViewsArea.ActiveDocView.Close(nFlags);

Actually, the prompt to save dialog I mention above may be coming from a subsequent call to

FControl.OpenDocFrom()

instead. If so, is there a param to use there to prevent this?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: OpenDocumentFromFile nFlags

Post by Sasha - Tracker Dev Team »

Hello Jeff,

The Close method is well documented along with it's flags:
https://sdkhelp.pdf-xchange.com/vie ... CloseFlags

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

Re: OpenDocumentFromFile nFlags

Post by jeffp »

Sorry, I missed that one. But just to confirm is this the best/only way to programatically close a document from the Control.

FControl.Frame.View.DocViewsArea.ActiveDocView.Close(nFlags);

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

Re: OpenDocumentFromFile nFlags

Post by Sasha - Tracker Dev Team »

Hello Jeff,

Well that is a correct way of closing a document. Depends on what you want to do.

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

Re: OpenDocumentFromFile nFlags

Post by jeffp »

FControl.Frame.View.DocViewsArea.ActiveDocView.Close(nFlags);

Seems to work for my purposes, but one interesting thing is that if I call

ADoc.Close(0)

where the ADoc is the CoreDoc of the document in the ActiveDocView above, it does not get closed from the UI. That is, it stays in the view.

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

Re: OpenDocumentFromFile nFlags  SOLVED

Post by Sasha - Tracker Dev Team »

You should not use the Core Level to close the Editor Level document.
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
jeffp
User
Posts: 914
Joined: Wed Sep 30, 2009 6:53 pm

Re: OpenDocumentFromFile nFlags

Post by jeffp »

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

Re: OpenDocumentFromFile nFlags

Post by Sasha - Tracker Dev Team »

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