Introducing Flex Printing

Printing from web applications has often been problematic in the past. A user would have to print from the browser and see a replica of the screen with odd page breaks and formatting. Now with Flex you have the power to build containers and components that will print exactly as you would like and do not have to be visible on the screen display at any time. The printed output does not have to be related to the screen display in any way.

Two classes are key to implementing this functionality:

  • FlexPrintJob A class that you instantiate and then can print one or more objects. The objects can be containers or custom components that you build specifically for displaying printed material. The class will also automatically split large objects over multiple pages and scale output to fit on a particular page size.

  • PrintDataGrid A subclass of the DataGrid control with appearance and functionality better suited for printing. The PrintDataGrid class has properties and methods that support printing grids that contain multiple pages of data.

The basic process for printing in Flex is as follows:


Instantiate an object from the FlexPrintJob class.


Start the print job using the FlexPrintJob's start() method.


Add an object or objects to be printed using the FlexPrintJob's addObject() method.


Send the job to the printer using the FlexPrintJob's send() method.


Clean up objects no longer needed after printing.

Adobe Flex 2.Training from the Source
Adobe Flex 2: Training from the Source
ISBN: 032142316X
EAN: 2147483647
Year: 2006
Pages: 225 © 2008-2017.
If you may any questions please contact us: