Skip to Main Content
Adobe AIR 1.5 Cookbook
book

Adobe AIR 1.5 Cookbook

by Rich Tretola, David Tucker, Marco Casario, Koen DeWeggheleire, Koen De Weggheleire
November 2008
Beginner to intermediate content levelBeginner to intermediate
446 pages
10h 38m
English
O'Reilly Media, Inc.
Content preview from Adobe AIR 1.5 Cookbook

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Breaking Out of the Web Browser with Adobe AIR

Breaking Out of the Web Browser with Adobe AIR

Jeff Tapper, Michael Labriola, Peter Dilillo, Tom Kaczanko, Andriy Kupriyenko, Louie Penaflor, Mike Nimer, Nathan Weber, Steve Zimmers
Adobe AIR Programming Unleashed

Adobe AIR Programming Unleashed

Stacy Tyler Young, Michael Givens, Dimitrios Gianninas

Publisher Resources

ISBN: 9780596156145Supplemental ContentErrata Page