Showing posts with label screen print. Show all posts
Showing posts with label screen print. Show all posts

Thursday, April 2, 2009

Flex print screen

This is a simple method to do a print screen from flex

private function doPrint(){

var printJob:FlexPrintJob = new FlexPrintJob();
   if (printJob.start() != true) return; 

Application.application.minHeight = Capabilities.screenResolutionY;
Application.application.minWidth = Capabilities.screenResolutionX;

printJob.addObject(UIComponent(Application.application),  FlexPrintJobScaleType.MATCH_WIDTH);
printJob.send();

 application.invalidateDisplayList();
application.invalidateSize();
application.invalidateProperties();
application.initialize();

}


Last and not the least call this function from your button or image or any thing..