Avoid javascript  SOLVED

PDF-XChange Viewer SDK for Developer's
(ActiveX and Simple DLL Versions)

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Post Reply
wings software
User
Posts: 18
Joined: Mon Apr 23, 2012 12:38 pm

Avoid javascript

Post by wings software »

Hi,

Is there a way to avoid embedded javascript to be executed when opening a pdf in the ActiveX Viewer? I did a test and I can automatically open a (potentially dangerous) web page using launchURL().
Since it is possible that my users open a pdf file that comes from an untrusted source (email) I want to avoid all automatically executed javascript.

Thanks,

Jan
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Avoid javascript

Post by Tracker Supp-Stefan »

Hello Jan,

Disabling JavaScript in general could prevent some files from working properly, if they rely on some code for e.g. their form fields. A better approach would be to handle the events wherever a JS is executed.
I would recommend you to take a look here:
https://help.pdf-xchange.com/DEV/de ... c_js_event

Regards,
Stefan
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Avoid javascript

Post by Vasyl-Tracker Dev Team »

Hi Jan.
I want to avoid all automatically executed javascript.
You may disable JS-executing fully by:

Code: Select all

pdfCtl.SetProperty("JavaScript.Enable", "false");
pdfCtl.SetProperty("JavaScript.WarnOnExecute", "false");
HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
wings software
User
Posts: 18
Joined: Mon Apr 23, 2012 12:38 pm

Re: Avoid javascript

Post by wings software »

You may disable JS-executing fully by:
Thanks, works great.

Jan
User avatar
Tracker Supp-Stefan
Site Admin
Posts: 17901
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Avoid javascript

Post by Tracker Supp-Stefan »

:)
Post Reply