Packagemx.printing
Classpublic class FlexPrintJob
InheritanceFlexPrintJob Inheritance Object

The FlexPrintJob class is a wrapper for the flash.printing.PrintJob class. It supports automatically slicing and paginating the output on multilple pages, and scaling the grid contents to fit the printer's page size.



Public Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  pageHeight : Number
[read-only] The height of the printable area on the printer page; it does not include any user-set margins.
FlexPrintJob
  pageWidth : Number
[read-only] The width of the printable area on the printer page; it does not include any user-set margins.
FlexPrintJob
  printAsBitmap : Boolean
Specifies whether to print the job content as a bitmap (true) or in vector format (false).
FlexPrintJob
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Public Methods
 MethodDefined By
  
Constructor.
FlexPrintJob
  
addObject(obj:IUIComponent, scaleType:String = "matchWidth"):void
Adds a UIComponent object to the list of objects being printed.
FlexPrintJob
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Sends the added objects to the printer to start printing.
FlexPrintJob
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Initializes the PrintJob object.
FlexPrintJob
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail
pageHeightproperty
pageHeight:Number  [read-only]

The height of the printable area on the printer page; it does not include any user-set margins. It is set after start() method returns.



Implementation
    public function get pageHeight():Number
pageWidthproperty 
pageWidth:Number  [read-only]

The width of the printable area on the printer page; it does not include any user-set margins. This property is set after start() method returns.



Implementation
    public function get pageWidth():Number
printAsBitmapproperty 
printAsBitmap:Boolean

Specifies whether to print the job content as a bitmap (true) or in vector format (false). Printing as a bitmap supports output that includes a bitmap image with alpha transparency or color effects. If the content does not include any bitmap images with alpha transparency or color effects, you can print in higher quality vector format by setting the printAsBitmap property to false.

The default value is true.



Implementation
    public function get printAsBitmap():Boolean
    public function set printAsBitmap(value:Boolean):void
Constructor Detail
FlexPrintJob()Constructor
public function FlexPrintJob()

Constructor.

Method Detail
addObject()method
public function addObject(obj:IUIComponent, scaleType:String = "matchWidth"):void

Adds a UIComponent object to the list of objects being printed. Call this method after the start() method returns. Each call to this method starts a new page, so you should format your objects in page-sized chunks. You can use the PrintDataGrid class to span a data grid across multiple pages.

Parameters

obj:IUIComponent — The Object to be printed.
 
scaleType:String (default = "matchWidth") — The scaling technique to use to control how the object fits on one or more printed pages. Must be one of the constant values defined in the FlexPrintJobScaleType class.

See also

send()method 
public function send():void

Sends the added objects to the printer to start printing. Call this method after you have used the addObject() method to add the print pages.

start()method 
public function start():Boolean

Initializes the PrintJob object. Displays the operating system printer dialog to the user. Flex sets the pageWidth and pageHeight properties after this call returns.

Returns
Booleantrue if the user clicks OK when the print dialog box appears, or false if the user clicks Cancel or if an error occurs.