
TUTORIALS POINT
Simply Easy Learning Page 115
Flex – Printing Support
F
lex provides a special class FlexPrintJob to print flex objects.
FlexPrintJob can be used to print one or more Flex objects, such as a Form or VBox container.
FlexPrintJob prints the object and all objects that it contains.
The objects can be all or part of the displayed interface.
The objects can be components that format data specifically for printing.
The FlexPrintJob class lets you scale the output to fit the page.
The FlexPrintJob class automatically uses multiple pages to print an object that does not fit on a single page.
The FlexPrintJob class causes the operating system to display a Print dialog box. You cannot print without
some user action.
Prepare and send a print job
You print output by preparing and sending a print job. Let's create an instance of the FlexPrintJob class
var printJob:FlexPrintJob = new FlexPrintJob();
Start the print job
printJob.start();
Flex will cause the operating system to display a Print dialog box. Add one or more objects to the print job and
specify how to scale them
printJob.addObject(myObject, FlexPrintJobScaleType.MATCH_WIDTH);
Each object starts on a new page. Send the print job to the printer
Commentaires sur ces manuels