Printing in Flex
I had to print something from Flex, but the LiveDocs weren't that helpful. I found this function and modified it to make it more generic...
<![CDATA[
import mx.core.IUIComponent;
import mx.printing.FlexPrintJob;
private function doPrint(printMe:IUIComponent):void{
var pj:FlexPrintJob = new FlexPrintJob();
if( pj.start() != true ){
return;
}
pj.addObject(printMe);
pj.send();
}
]]>
</mx:Script>
Then define some display object you'll want to print. I loaded another component into this canvas.
id="formContent" backgroundColor="#ffffff"/>
And a button to print, passing it the component above. It's that simple!


There are no comments for this entry.
[Add Comment]