Sunday, March 28, 2010

Lower version checking not working.

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 %26lt; app.plugIns.length; i++){
?if (app.plugIns[i].name == ''Forms''){
?var RminorFormVersion = app.plugIns[i].version;
?}
}

var readerMinorVersionCheck = '''' + RminorFormVersion;

if (readerMinorVersionCheck %26lt;= 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();
?}
}
}

Lower version checking not working.

You should be using the event.target.closeDoc(); Note that the doc will not close if it is the last document open in the browser. Therfore you must redirect then do the doc close. I have modified your sample. See attached.

Paul

Lower version checking not working.

Paul,

?Thank you for your response..I saw that you placed the code in the DocReady event. And I tested the PDF in 7.0 version reader. I am still getting the Crashing messages as in the attached document. In my case, the PDF is generated from the AFS each time when the user try to download.

Thank you for your time..

Srini

Attached the document with the crash messages.

No comments:

Post a Comment