These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

supressing security alerts when form tries to call a web servlet

adoacr
Registered: May 4 2011
Posts: 41

Hi,
 
I have a form that calls a servlet function to submit data doing a post.
Problem is that the first time the user fills up the data and hits submit, it shows a yellow alert at top, near the toolbar asking if the user wants to allow
this only one time, every time etc.. and then just loops back and the user has
to hit submit again to resubmit the form.
 
Is there anyway these alerts can be suppressed/reduced

adoacr
Registered: May 4 2011
Posts: 41
I guess what I am asking is that how do I make this call to a web servlet a trusted function in javascript?
I need this to work with a wide audience of users.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
For that you need to place the trusted function in a folder-level script that is installed on the local machine.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

adoacr
Registered: May 4 2011
Posts: 41
can I check from Document level javascript to see if speciifc folder-level script is available and if not
write out the folder-level script? How could i do this? thx
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
NO - the whole point of folder-level scripts is that they CANNOT be created by anything hiding in a document, so they can be trusted to do additional tasks.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
You can use the 'typeof' operator to test the the unevaluated operator to see if it is 'undefined', 'object', 'string', 'number', 'function', 'object', etc.

You can not create a folder level script from Acrobat/Reader. The folder level JS must exist before Acrobat/Reader is initialized. The code also has to be installed by the user so they have a chance to review it before it is run.

George Kaiser

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Yes and no. You can check if a certain function exists, but you can't write it in case it doesn't (for the reasons mentioned by UVSAR).

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

adoacr
Registered: May 4 2011
Posts: 41
can I prompt the user to install the folder level javascript in a dialog box? or is there some kind of plug-in update procedure/framework in acrobat reader to get the user to install the folder-level javascript. Would this be supported on mobile platforms too?
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
As we've already said, several times: folder-level scripts *CANNOT* be installed by anything in a document, no matter what you try and do, as if Acrobat/Reader allowed that it would be a huge security problem.

Plugins can install whatever scripts they want, but:

1) A document cannot install an "embedded" plugin, or automatically download one, for the reasons outlined above.
2) You cannot distribute a plugin for Reader without an Adobe developer key, which you have to pay for.
3) Plugins (and most of JavaScript) are not supported on mobile devices. I can't see plugins _ever_ being supported, it's not the way mobile apps work.
4) Adobe pre-approves all Reader plugins, and one whose sole job is to bypass security features will be rejected.

If Adobe wanted untrusted (and therefore potentially-malicious) documents to have the ability to hide the DMB, they would have included a method to do it. They haven't, so they don't, so you can't.
gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
The following is how Acrobat/Reader starts up:

The application is started.

The application level folder for JavaScript is searched for the JS file type.
Found JS file types are read checking for syntax and tokeninzing the lines of code.

The user application level folder for JavaScript is searched for the JS file type.
Found JS file types are read checking for syntax and tokeninzing the lines of code.

If a PDF or FDF has been used to start Acrobat/Reader then the document level scripts are processed followed by the page open action JavaScripts and then the field level JavaScripts are processed.

Only scripts add within a document will be tokenized and made available while a document is open. I should also note that only Acrobat can add or modify JavaScript code within an open PDF. JavaScript within a PDF document is reprocessed each time it is called.

Acrobat/Reader will not process any changes to either the application folder or the user specific application folder until Acrobat/Reader is restarted. You can verify this yourself by adding and deleting JS files for either of the 2 application level folders.

So if you detect a needed application level script or variable is missing, you can only alert the user of the necessary action to take to add the needed code, but the user will need to fully exit Acrobat/Reader, install the code, restart Acrobat/Reader, and then reopen the PDF being processed.


George Kaiser