Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Version Control

Avatar

30-03-2009

How could I prevent a user from using older version of Reader <7 and Acrobat <9?



Is there a way to have it open in Reader by default?



Thanks,

Replies

Avatar

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile
Niall_O_Donovan
Level 10

30-03-2009

Hi,



You could try something like this:



var oType = xfa.host.appType;

var oVersion = xfa.host.version;



if (oType == "Reader" && oVersion < 7)

{

app.alert("some message...);

}



if (oType == "Extended" | oType == "Extended-Pro" && oVersion < 9)

{

app.alert("a different message...");

}



I haven't tested it and I know from previous experience that it is difficult to get a "app.execMenuItem("Close");" script to work. The best we achieved was to have a hidden numeric field with the initialised value set to zero. This hidden field had script, if its value was changed to 1 then it executed the "close" script.



If the criteria was met that the file should not be opened instead of the app.alert above we had script thta changed the value from 0 to 1, invoking the "close" event. Because the PDF had changed (numeric field changing from 0 to 1) the user was asked if they wanted to save the file before closing. As part of that was a cancel button, which if clicked meant that the file did not close.



This was a real messy work around, so I will be interested to see if someone has a more elegant solution.



Good luck,



Niall

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

30-03-2009

You can set the target version in File/Form Properties/Defaults. if they open with something earlier then a warning is displayed. They will be able to continue if they choose. You can write javascript that can check the versions as well as the viewer (Acrobat or Reader) and not allow them to continue if you want.

Avatar

30-03-2009

Thank Niall! works great!



How about making the subform presence hidden? For me that makes the form useless. 😄



Thank you again!

Avatar

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 10
Niall_O_Donovan
Level 10

Likes

646 likes

Total Posts

4,352 posts

Correct Reply

786 solutions
Top badges earned
Validate 1
Boost 500
Boost 50
Boost 5
Boost 3
View profile
Niall_O_Donovan
Level 10

30-03-2009

Glad it worked for you!



In addition to the app.alerts you could have script like:



subform.presence = "hidden";



I would keep the app.alerts, so that you are informing the user why the file has just gone blank!



Good luck,



Niall