User's choice to suppress a message is not obeyed

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
mbertin
User
Posts: 2
Joined: Mon May 23, 2016 10:16 am

User's choice to suppress a message is not obeyed

Post by mbertin »

I have disabled JavaScript as explained in
https://forum.pdf-xchange.com/ ... 36&t=21352

Seems that if there are multiple scripts in a PDF document, the viewer asks user for permission to execute each script separately:

---
This document contains JavaScript. Do you wish to enable all JavaScript actions in this document?
The document may not behave correctly if they are disabled.
[ ] Suppress this message - until this document is reopened
---

Even if I tick the "Suppress this message" box, the permission query is presented for all scripts in the document. Is there any way in the API to force the viewer to remember user's choice?
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: User's choice to suppress a message is not obeyed

Post by Vasyl-Tracker Dev Team »

Hi, mbertin.

You may use it to suppress this warning for all documents:

Code: Select all

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.
mbertin
User
Posts: 2
Joined: Mon May 23, 2016 10:16 am

Re: User's choice to suppress a message is not obeyed

Post by mbertin »

Thanks for the answer.

Code: Select all

pdfCtl.SetProperty("JavaScript.WarnOnExecute", "false");
works as expected (warning is not displayed at all). But if I want the viewer to present the warning only once each time a document is loaded, can I do that? Seems that each script in a document (if there are multiple scripts) triggers separate warning dialog. To elaborate the use case a bit more, our software allows the user to scroll list of documents (including PDFs) and shows a preview of the the selected document using the viewer API next to the listing. If a PDF contains multiple scripts embedded, it would be more user friendly to show the warning only once when the user selects the document.
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2353
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: User's choice to suppress a message is not obeyed

Post by Vasyl-Tracker Dev Team »

I'm afraid, but currently you have not possibility to get/control the document's private flag related to "Suppress this message - until this document is reopened".
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.
Post Reply