Expand my Community achievements bar.

Forcing the use of Reader 7.0?

Avatar

Former Community Member
How do I force my PDF document to only be opened in Acrobat Reader 7.0 [or later]?



I am creating PDF-forms to test students. I would prefer them not to be able to open the document in any other PDF compatible application, as I can not be sure of the activities a student could perform on the document. I know I can not control the applications that could open the file, but can I limit Adobes applications to just Acrobat Reader 7.0 [or later]?
5 Replies

Avatar

Former Community Member
I don't know about preventing the form from being opened, but you can add logic to the form initialize script that would issue the user a warning:



//check version of Acrobat

var appVer = app.viewerVersion;



if (appVer < 7) {

var viewerMsg =

"You are currently using Acrobat Viewer Version = " + appVer + ".\n\n"

+ "This PDF document requires a newer version of Acrobat.\n\n"

+ "Please visit http://www.adobe.com/products/acrobat/readstep2.html\n"

+ "to download the latest version of Adobe Acrobat Reader.\n\n";



xfa.host.messageBox(viewerMsg);

}

Avatar

Former Community Member
The form will already give that warning to users with Adobe 6 or older versions.



Any other suggestions

Avatar

Former Community Member
Thanks you both for your comments.



I have developed a bit further.



If I place the following code in the DocReady event of a button on the form, the message is displayed but the document loads and displays as it normally would.



However, if I copy & paste the same code into the Click event of the same button, when I click the button, the message is displayed, IE opens and the Acrobat Reader download page is displayed, and the document (but not Acrobat Reader) closes, which is precisely the behaviour I am seeking.



So the question is now: why does it not work from the DocReady event?



- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



//check version of Acrobat

var appVer = app.viewerVersion;



if (appVer < 7) { var viewerMsg =

"You are currently using Acrobat Reader version " + appVer + " .\n\n"

+ "This PDF document requires Acrobat Reader version 7.0 or later.\n\n"

+ "---------------------------------------------------------------------------------------\n\n"

+ "Please download and install the lastest version of Acrobat Reader from:\n\n"

+ "http://www.adobe.com/products/acrobat/readstep2.html";



xfa.host.messageBox(viewerMsg);



xfa.host.gotoURL("http://www.adobe.com/products/acrobat/readstep2.html");



app.execMenuItem("Close");



}

Avatar

Former Community Member
Not sure why it isn't working on the docReady event, but another option would be to make your entire form read only if they aren't using the correct version.



Another option would be to hide everything on your page and display some text on the page instead if they are using the incorrect version. This can easily be done by using subforms and making the subforms visible or invisible depending on what you want to do.