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
Avoid javascript SOLVED
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 19864
- Joined: Mon Jan 12, 2009 8:07 am
Re: Avoid javascript
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
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
-
- Site Admin
- Posts: 2445
- Joined: Thu Jun 30, 2005 4:11 pm
Re: Avoid javascript
Hi Jan.
HTH.
You may disable JS-executing fully by:I want to avoid all automatically executed javascript.
Code: Select all
pdfCtl.SetProperty("JavaScript.Enable", "false");
pdfCtl.SetProperty("JavaScript.WarnOnExecute", "false");
PDF-XChange Co. LTD (Project Developer)
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
-
- User
- Posts: 18
- Joined: Mon Apr 23, 2012 12:38 pm
Re: Avoid javascript
Thanks, works great.You may disable JS-executing fully by:
Jan
-
- Site Admin
- Posts: 19864
- Joined: Mon Jan 12, 2009 8:07 am