Avoid javascript  SOLVED

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

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

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

Avoid javascript

Post by wings software » Fri May 20, 2016 12:37 pm

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: 14585
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Avoid javascript

Post by Tracker Supp-Stefan » Fri May 20, 2016 1:35 pm

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:
http://help.tracker-software.com/DEV/de ... c_js_event

Regards,
Stefan

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

Re: Avoid javascript

Post by Vasyl-Tracker Dev Team » Thu May 26, 2016 12:36 am

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: 19
Joined: Mon Apr 23, 2012 12:38 pm

Re: Avoid javascript

Post by wings software » Tue May 31, 2016 3:23 pm

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

Jan

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

Re: Avoid javascript

Post by Tracker Supp-Stefan » Tue May 31, 2016 3:40 pm

:)

Post Reply