cancel open site dialog

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.
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

cancel open site dialog

Post by MartinCS »

Hello Trackers,

using the PDF Viewer SDK it is possible to suppress / overwrite the security dailog showing up when a user clicks a hyperlink inside of a pdf document.

Code: Select all

Dim vDataOut As Object = ""
If (modMisc.StrCompare(pName, "Prompts.ConfirmOpenSite")) Then

 vDataIn = "Yes"
 AxCoPDFXCview1.SetProperty("Prompts.ConfirmOpenSite.UserChoice", vDataIn, 0)
 Exit Sub
				
End If
Is there an appropriate event id for PDF Editor SDK, which I can register to? I had a look at the available Editor events (https://www.pdf-xchange.com/forum3 ... 172#p94313) and could not find a possible option.

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

Re: cancel open site dialog

Post by Sasha - Tracker Dev Team »

Hello Martin,

You can change these settings Security.OpenFilePerm Security.OpenSitePerm to allow opening all of the links:

Code: Select all

pdfCtl.Inst.Settings["Security.OpenFilePerm"].v = 1; //allow
pdfCtl.Inst.Settings["Security.OpenSitePerm"].v = 1; //allow
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

Re: cancel open site dialog

Post by MartinCS »

Alex,

I included the two code lines. But I still get the warning message dialog:
03-11-_2016_15-26-33.zip
Is there another setting which can be used to suppress this dialog?

Thanks,
Martin
You do not have the required permissions to view the files attached to this post.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: cancel open site dialog

Post by Sasha - Tracker Dev Team »

Everything worked for me. I am using the code from the form's constructor though. Try using this:

Code: Select all

pdfCtl.Inst.Settings["Security.OpenFilePerm"].v = 1; //allow
pdfCtl.Inst.Settings["Security.OpenSitePerm"].v = 1; //allow
pdfCtl.Inst.FireAppPrefsChanged(PDFXEdit.PXV_AppPrefsChanges.PXV_AppPrefsChange_Security);
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

Re: cancel open site dialog

Post by MartinCS »

I'm running this code in the constructor of a windows form as well:

Code: Select all

PxvInst.Settings["Docs.SingleWnd"].v = false;
PxvInst.Settings["Docs.HideSingleTab"].v = false;
PxvInst.Settings["Docs.AutoSyncDocPanesLayouts"].v = true;

PxvInst.FireAppPrefsChanged(PXV_AppPrefsChanges.PXV_AppPrefsChange_Documents);

PxvInst.Settings["Security.OpenFilePerm"].v = 1;
PxvInst.Settings["Security.OpenSitePerm"].v = 1;

PxvInst.FireAppPrefsChanged(PXV_AppPrefsChanges.PXV_AppPrefsChange_Security);
Is there an error using the FireAppPrefsChanged method twice?


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

Re: cancel open site dialog

Post by Sasha - Tracker Dev Team »

Nope, that's not an error. If you are having troubles with that, please create a small project with these settings included and a test document so that we can test it and hopefully find out what's wrong.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
User avatar
MartinCS
User
Posts: 153
Joined: Thu Apr 07, 2011 10:01 am

Re: cancel open site dialog

Post by MartinCS »

Hi Alex,

I created a project containing the code I'm using when opening a pdf document within PDF Editor (using the latest build).
CancelOpenSiteDialog.zip
My "problem" is that it is working now. While creating the sample project and noticed it is working I tried to comment out code which is running in my main project to find the difference. I ended up with the "ImportUserSettings()" routine which uses this code part (full code see sample project):

Code: Select all

var op =
	pdfCtl.Inst.CreateOp(pdfCtl.Inst.Str2ID("op.settings.import"));

if (op == null)
{
	return;
}

...

op.Params.Root["Input"].v = fsInst.DefaultFileSys.StringToName(fileName);
op.Do();
After commenting it out once in my main project suppressing the security warning dialog worked. I uncommented it again and it is working now.

I think the problem was that I ran the new securtiy settings first (inside of the constructor) and the ImportSettings routine afterwards, which caused the security settings to be overwritten. Could that be the case?

Cheers,
Martin
You do not have the required permissions to view the files attached to this post.
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am

Re: cancel open site dialog

Post by Sasha - Tracker Dev Team »

Hello Martin,

Of course this can be the problem - you have overwritten the settings that you've just modified thus the modifications were nullified. These modifications should be done after all of the settings import (if you need one - not sure why though).

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