build .318 : Is there a way to prevent warning windows from showing when opening a PDF?

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
docu-track99
User
Posts: 518
Joined: Thu Dec 06, 2007 8:13 pm

build .318 : Is there a way to prevent warning windows from showing when opening a PDF?

Post by docu-track99 »

Please have a look at the attached PDF document. When you open it, there is a warning message that appears. Is there a way to programatically suppress this with open arguments?

Any help would be appreciated,
Thanks.
Attachments
Integrity First G7 2nd qtr 2016.zip
(89.46 KiB) Downloaded 66 times
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: build .318 : Is there a way to prevent warning windows from showing when opening a PDF?

Post by Sasha - Tracker Dev Team »

Hello docu-track99,

Why this dialog is showing in the first place is because there are open JS scripts in this pdf that run on document start.
The e.document.beforeRunOpenScripts is running before the scripts and the e.document.afterRunOpenScripts is running after the JS execution. Though these two are purely informative and can't change anything.
Though there is a way to disable the open scripts. The two above events can be used to fill the bool variable that indicates that the scripts were started and ended. This will allow to monitor the e.document.beforeRunAction that takes place after the e.document.beforeRunOpenScripts before each individual JS execution. In this case, when you catch the e.document.beforeRunAction event and the bool flag that indicates that you are in the e.document.beforeRunOpenScripts section is true then you should mark the event as handled and set the event result to non 0:

Code: Select all

e.pEvent.Handled = true;
e.pEvent.Result = 1;
This will tell the code that you've handled the scripts execution for yourself and will break the further execution.

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