|PDF Xtra for Director
||license & registration
||PDF Xtra 7
Although PDF Xtra has the ability to run Adobe Reader from the CD-ROM, there may be problems with this launch scheme, depending on what versions of Acrobat or Reader have been previously installed on the user's system, and on the state of the system registry.
The safest way to ensure that the Adobe application is launched correctly is to require the end-user to install Adobe Reader prior to running your application, if it is not already present on his system.
In addition to providing users with a set of instructions and requirements for using your application, you can call the PDF Xtra method PDF_AcrobatInfo() at runtime to check to see if a specific version of Acrobat or Reader or (or Preview on Mac OS X) is installed and then notify the user if no suitable application is found.
The sample code below checks to see if Acrobat or Reader version 5 or higher is installed. If it is, this code launches the found application from the specified path, by calling PDF_LaunchViewer() method; if not, an alert is displayed telling the user to install the free Adobe reader and start again.
In you own application you may want to take the user to a special frame of your movie where there is a link to the Adobe website, from which they can download and install Reader and then restart.
-- test for presence of Acrobat or Reader 5, 6, or 7 and alert user if not installed
launchPath = getViewerPath()
if (launchPath <> "") then
-- Acrobat or Reader is installed; launch from path
PDF_LaunchViewer([#launchScheme: #custom, #path: launchPath])
-- Alert user to install Adobe Reader
Alert("Adobe Acrobat or Reader is required to use this application." & RETURN & \
"Please install the Free Adobe Reader from Adobe's web site and restart.")
-- return path of installed Acrobat/Reader if the version is 7
set x = PDF_AcrobatInfo()
repeat with i = 1 to count(x)
set app = GetProp(GetAt(x, i), #appname)
set ver = GetProp(GetAt(x, i), #version)
set path = GetProp(GetAt(x, i), #path)
if (app = "Reader") OR (app = "Acrobat") then
if ((char(1) of ver) >= 5 ) then -- looking for version 5 or higher
return "" -- return empty string if no appropriate version of Acrobat or Reader was found
*The PDF_LaunchViewer method, introduced in PDF Xtra 7.0 replaces the PDF Xtra 3.x method named PDF_LaunchAcrobat.