You use the FlexPrintJob class to print one or more Flex objects, such as a Form or VBox container.
你可以使用 FlexPrintJob 类来打印一个或多个 Flex 对象, 例如: Form 或 VBox 容器.
For each object that you specify, Flex prints the object and all objects that it contains.
对于你指定的每一个对象, Flex 将会打印这个对象以及这个对象中所包含的所有对象.
The objects can be all or part of the displayed interface, or they can be components that format data specifically for printing.
这些对象在显示界面中可以全部或部分显示, 或者专门为打印输出的格式化数据的组件.
The FlexPrintJob class lets you scale the output to fit the page, and automatically uses multiple pages to print an object that does not fit on a single page.
FlexPrintJob 类能让你按比例以合适的大小输出到页面, 并且打印一个对象如果一张页面不够时, 会自动输出到多张页面.
You use the FlexPrintJob class to print a dynamically rendered document that you format specifically for printing.
你可以使用 FlexPrintJob 类打印按指定格式动态提交的文档.
This capability is especially useful for rendering and printing such information as receipts, itineraries, and other displays that contain external dynamic content, such as database content and dynamic text.
这项功能特别有用, 例如: 打印收入信息, 旅游活动日程和其他显示包含外部扩展的动态内容, 例如: 数据库内容和动态文本.
You often use the FlexPrintJob class within an event listener. For example, you can use a Button control with an event listener that prints some or all of the application.
你通常使用 FlexPrintJob 类在一个事件监听器中, 例如: 你可以使用一个 Button 控件, 在它的事件监听事件中打印部分或全部应用程序.
1. Create an instance of the FlexPrintJob class
var printJob:FlexPrintJob = new FlexPrintJob();
2. Start the print job
printJob.start();
3. Add one or more objects to the print job and specify how to scale them:
printJob.addObject(myObject, FlexPrintJobScaleType.MATCH_WIDTH);
4. Send the print job to the printer:
printJob.send();