Avatar

Level 10

I am trying to check the version of the Adobe Reader and if it is less than 8.1.2 then I want the user to download a latest version of Adobe Reader and PDF file should not open for the user.. Using the below code in my PDF in the Initialize event of the Submit button to test the version and force user to down load the latest version.. It is giving the custom message when I open the file in Reader 7.0, but it is giving the errors for validate events and then giving a crashing message before closing the app.

I have seen multiple threads in the forum on how to close the app in different ways.. But they are not helpful in this case.. Below are 3 ways I tried in the Initialize event of the Submit Button. Can anyone have any idea what was wrong with my code..

1) event.target.closeDoc();

2) app.execMenuItem("Close");

3) this.closeDoc();

var

viewerType = app.viewerType;

if (viewerType=="Reader")
{
for (var i = 0; i < app.plugIns.length; i++){
  if (app.plugIns[i].name == "Forms"){
      var RminorFormVersion = app.plugIns[i].version;
  }
}

var readerMinorVersionCheck = "" + RminorFormVersion;

if (readerMinorVersionCheck <= 8.12){
 
  var ans = xfa.host.messageBox("You do not have the recommended Adobe software installed on your machine.  For full PDF functionality and security,  please download the latest version of Adobe Reader by clicking Yes." , "Version",  3,2);
  if (ans == 3) {  
   //No is selected 
   event.target.closeDoc();  
  }
  else{
      //Yes is selected
   app.launchURL("http://www.adobe.com/reader",false);
   event.target.closeDoc();
  }
}
}