Expand my Community achievements bar.

Attention: Experience League Community will undergo scheduled maintenance on Tuesday, August 20th between 10-11 PM PDT. During this time, the Community and its content will not be accessible. We apologize for any inconvenience this may cause.

javascript for detecting acrobat 8

Avatar

Level 1
We have a fillable form that has been giving us headaches. The people I have talked to did not download 8, even through on the page it says several times that you must have 8. Anyone know of a javascript to detect if they have 8 or not? Thanks!
6 Replies

Avatar

Level 5
You can try app.viewerVersion.



app.alert("app.viewerType: " + app.viewerType);

app.alert("app.viewerVariation: " + app.viewerVariation);

app.alert("app.viewerVersion: " + app.viewerVersion);



These display info about the viewer in use.



Mark

Avatar

Level 1
Would I put this on the page before they click on the form?

Avatar

Level 7
>Would I put this on the page before they click on the form?



You don't. And I would very strongly advise you don't try. (What if

they are downloading and filling on a different computer? What if

browser integration is off?)



Instead, if the viewer version is critical, just put a warning message

into the PDF with JavaScript so they will see it when the file is

opened.





Aandi Inston

Avatar

Level 5
You could add a hidden field on the form, or use in an existing field - program the docReady event.



The following will test the version, and close the form based on the version found:



if (app.viewerVersion < 8) {

app.alert("Acrobat is not the right version - please upgrade to version 8");

app.execMenuItem("Close");

} //END IF



You can change the message in the alert any way you wish, usually best to direct the user to someone

Avatar

Level 10
Have you set the target version of the form in the Form Properties (Defaults tab)?



I just gave it a try with Reader 6 and it pops up a warning saying you have to download a new version.

Avatar

Level 1
Great - thanks guys. I'll try this!