views:

961

answers:

2

Thanks to FireFox's buggy implementation of ActiveX components (it really should take an image of them when printing) Flex components (in our case charts) don't print in FX.

They print fine in IE7, even IE6.

We need these charts to print, but they also have dynamic content. I don't really want to draw them again as images when the user prints - the Flex component should do it.

We've found a potential workaround, but unfortunately it doesn't work in FireFox 3 (in FX2 it sort-of works, but not well enough).

Anyone know a workaround?

+3  A: 

Using the ACPrintManager I was able to get firefox 3 to print perfectly!

The one thing I had to add to the example was to check if stage was null, and callLater if the stage was null.

private function initPrint():void {
    //if we don't have a stage, wait until the next frame and try again
    if ( stage ==  null ) {
     callLater(initPrint);
     return;
    }

    PrintManager.init(stage);

    var data:BitmapData = new BitmapData(stage.stageWidth, stage.stageHeight);
    data.draw(myDataGrid);

    PrintManager.setPrintableContent(data);
}
maclema
A: 

Thanks. A load of callLater-s added to our custom chart code seems to have done it.

Keith