Chapter 6. PDF Support
Detecting Whether PDF Support Is Available
Problem
You want to detect whether the user is able to display PDF content in your AIR application.
Solution
Read the value of the HTMLLoader.pdfCapability
property to check that the user has a version of Adobe Reader or
Adobe Acrobat 8.1 (or newer) installed.
Discussion
The HTMLLoader.pdfCapability
property is set to one of the following constants of the HTMLPDFCapability
class:
HTMLPDFCapability.STATUS_OK
HTMLPDFCapability.ERROR_INSTALLED_READER_NOT_FOUND
HTMLPDFCapability.ERROR_INSTALLED_READER_TOO_OLD
HTMLPDFCapability.ERROR_PREFERRED_READER_TOO_OLD
If the property has the value of the constant HTMLPDFCapability.STATUS_OK
, then you are sure
that PDF content can be loaded into the HTMLLoader
object. It also can happen that the
user does not have the right version of Adobe Reader installed. If the
installed Adobe Reader version is too old, then the constant ERROR_INSTALLED_READER_TOO_OLD
is returned
when you call the HTMLLoader.pdfCapability
property. If the user
has different versions of Adobe Reader installed but the one that is set
up to handle PDF content is older than Adobe Reader 8.1, the constant
ERROR_PREFERRED_READER_TOO_OLD
is
returned. If the user has no version of Adobe Reader installed at all,
then the HTMLLoader
object will not
be able to display any PDF content.
Working with PDF content on Windows involves one other important caveat. If Adobe Acrobat or Adobe Reader version 7.x (or newer) is opened on the user’s ...
Get Adobe AIR 1.5 Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.