views:

269

answers:

1

In s Flex 3 app, I have canvas with a PNG image for a background. The image is the same width & height as the canvas. I also have some other controls in the canvas:

<mx:Canvas id="form" backgroundImage="@Embed(source='images/formBkg.png')" width="640" height="480" >
    <mx:label .../>
    <mx:label .../>

I print the canvas using the following code:

var printJob:FlexPrintJob = new FlexPrintJob();

if (printJob.start())
{
    printJob.addObject(form, FlexPrintJobScaleType.SHOW_ALL);
    printJob.send();
}

On screen it looks great, but when I print it the quality of the png degrades. It is not terrible, but not as sharp as what is shown on screen.

Is there anything I can do to improve the quality of the printed png?

+1  A: 

Flex doesn't do a great job at printing (caveman approach of creating a big image and shove it in the printer). you should consider external libraries such as AlivePDF

Yea, I had a hunch that was only option after reading several articles night. Could you point me towards a tutorial on how to print Flex components using AlivePDF? I am having difficulty finding one.
TERACytE
How about this http://www.rogue-development.com/blog2/2007/08/alivepdf-flexair-example/
That article creates a PDF, but does not print it.
TERACytE
I found a nice example at http://www.kalengibbons.com/blog/index.php/2009/03/custom-printing-with-flex-part-2-generating-pdfs-with-alivepdf/. Going to check it out.
TERACytE