Packageat.display
Classpublic class PDFViewer
InheritancePDFViewer Inheritance mx.core.UIComponent

PDFViewer This class displays PDF files using the HTMLLoader class. Since HTMLLoader is not a Flex class it does not implement the IUIComponent interface and therefore, cannot be made a child to any Flex container. This class is a work-around that creates a wrapper class which extends UIComponent and then sizes the HTMLLoader to fit.



Public Properties
 PropertyDefined by
  debugMode : Boolean = false
Outputs useful information for debugging this component for developers when true.
PDFViewer
  exitFullScreenBeforeLoadAndReturnAfterClose : Boolean = true
Due to a AIR limitation that does not allow PDF files to be viewed while the application is in StageDisplayState.FULL_SCREEN_INTERACTIVE mode, if this poperty is true the PDFViewer automatically sets the application display state to StageDisplayState.NORMAL before loading a PDF, and returns the application display state to StageDisplayState.FULL_SCREEN_INTERACTIVE when the PDF is closed.
PDFViewer
  modal : Boolean = true
PDFViewer
  overlayFadeInDuration : int = 500
Duration that it takes the Overlay Module to fade in the PDFViewer
PDFViewer
  overlayStyleName : String = ""
Style name used for the overlay, Over Module's default style is used if left empty
PDFViewer
  overlayTitle : String = "PDF Viewer"
Title that appears in the Overlay Module containing the PDFViewer
PDFViewer
  source : String
Getter method for retrieving the variable _source.
PDFViewer
  titleWindow : TitleWindow
PDFViewer
  uniqueID : String
Returns the unique identifier (if it was specified) associated with the content loaded in the PDF viewer.
PDFViewer
  usePopUp : Boolean = false
PDFViewer
Public Methods
 MethodDefined by
  
Constructor.
PDFViewer
  
load(url:String):void
Loads the given PDF document URL.
PDFViewer
  
loadWindowedPDF(url:String = null, uniqueID:String = ""):void
Loads the windowed PDF document URL.
PDFViewer
Protected Methods
 MethodDefined by
  
Method for saving new properties upon a source change.
PDFViewer
  
Create the HTMLLoader and makes it a child of this UIComponent instance.
PDFViewer
  
measure():void
Assigns a standard width and height if one is not explicitly assigned to this component.
PDFViewer
  
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Sizes the HTMLLoader (pdf) to fill the entire component area.
PDFViewer
Events
 EventSummaryDefined by
    PDFViewer
   A complete event is dispatched once the PDF has been loaded.PDFViewer
Property detail
debugModeproperty
public var debugMode:Boolean = false

Outputs useful information for debugging this component for developers when true.

The output is typically in the form of trace statements and Alerts.

The default value is false.

exitFullScreenBeforeLoadAndReturnAfterCloseproperty 
public var exitFullScreenBeforeLoadAndReturnAfterClose:Boolean = true

Due to a AIR limitation that does not allow PDF files to be viewed while the application is in StageDisplayState.FULL_SCREEN_INTERACTIVE mode, if this poperty is true the PDFViewer automatically sets the application display state to StageDisplayState.NORMAL before loading a PDF, and returns the application display state to StageDisplayState.FULL_SCREEN_INTERACTIVE when the PDF is closed.

modalproperty 
public var modal:Boolean = true
overlayFadeInDurationproperty 
public var overlayFadeInDuration:int = 500

Duration that it takes the Overlay Module to fade in the PDFViewer

The default value is 500.

overlayStyleNameproperty 
public var overlayStyleName:String = ""

Style name used for the overlay, Over Module's default style is used if left empty

The default value is "".

overlayTitleproperty 
public var overlayTitle:String = "PDF Viewer"

Title that appears in the Overlay Module containing the PDFViewer

The default value is PDF Viewer.

sourceproperty 
source:String  [read-write]

Getter method for retrieving the variable _source.

Implementation
    public function get source():String
    public function set source(value:String):void
titleWindowproperty 
public var titleWindow:TitleWindow
uniqueIDproperty 
uniqueID:String  [read-write]

Returns the unique identifier (if it was specified) associated with the content loaded in the PDF viewer.

Implementation
    public function get uniqueID():String
    public function set uniqueID(value:String):void
usePopUpproperty 
public var usePopUp:Boolean = false
Constructor detail
PDFViewer()constructor
public function PDFViewer()

Constructor.

Method detail
commitProperties()method
protected override function commitProperties():void

Method for saving new properties upon a source change.

createChildren()method 
protected override function createChildren():void

Create the HTMLLoader and makes it a child of this UIComponent instance.

load()method 
public function load(url:String):void

Loads the given PDF document URL.

Parameters
url:String
loadWindowedPDF()method 
public function loadWindowedPDF(url:String = null, uniqueID:String = ""):void

Loads the windowed PDF document URL.

Parameters
url:String (default = null) — content to load
 
uniqueID:String (default = "") — Associates a unique id with the loaded content, useful if tracking which PDFs are being viewed. Note this only applies
measure()method 
protected override function measure():void

Assigns a standard width and height if one is not explicitly assigned to this component.

updateDisplayList()method 
protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void

Sizes the HTMLLoader (pdf) to fill the entire component area.

Parameters
unscaledWidth:Number
 
unscaledHeight:Number
Event detail
closeevent 
Event object type: flash.events.Event

completeevent  
Event object type: flash.events.Event

A complete event is dispatched once the PDF has been loaded.