Hi, 

I'm trying to understand how printing works in Flex.

First, I saw in the documentation both mx.print.FlexPrintJob and 
flash.print.PrintJob being 
used, with slightly different syntax. Which one is the preferred way to print 
from Flex? (I 
guess it must be FlexPrintJob - but what are the advantages/disadvantages of 
each?)

I saw in the examples that use FlexPrintJob that a component that is to be 
printed is first 
added to the current application. For instance, I saw examples like this:

var pj:FlexPrintJob = new FlexPrintJob();
if (pj.start()) {
                var box:PrintableView = new PrintableView();
                box.width = pj.pageWidth;
                box.height = pj.pageHeight;
                this.addChild(box);                                     
                pj.addObject(box);                                              
                pj.send();
                this.removeChild(box);
}                                               

Adding and then removing the component from the application causes the strange 
effect 
of PrintableView (in the above example) to be added to the app for a moment. 
Ideally, I 
wouldn't want to show the print-only component at all (not add it to the 
visible component 
tree), I'd just simply want to print it. But if I don't add the component 
first, then it doesn't 
printing either. How could that be accomplished?

Thanks,
 
-- Frank

Reply via email to