I have also had a number of problems with support for printing in Flex so I started to look outside of Flex for a solution.  There are probably a number 3rd party tools that you could try however as I am more comfortable with Java and Flex is running in a Java app server anyway, I have implemented a solution that works very well for what I am trying to achieve with iText.  iText is a free Java PDF library and can be found here http://www.lowagie.com/iText/  this has also been ported to .NET if anyone is interested in that.
 
The way I have integrated this with Flex is via a Servlet and then using the getURL method in Flex.  This dynamically creates a pdf every time the servlet is called.  I am ableto add headers, footers, images, tables etc, and the list goes on.
 
I'm not sure if this will meet everyone's needs or how support for printing in Flex will improve with future releases of Flex, however this meets and exceeds the printing needs of what I need to do.  If anyone is interested in a working example, just let me know and I will post a simple example I have working.  If anyone from MM has looked intothis or has any comments on using iText that would be great also.
 
 
Regards
Mark Hitchcock
 


From: Manish Jethani [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 March 2005 12:42 AM
To: [email protected]
Subject: Re: [flexcoders] Re: Advanced Printing Question

AC wrote:

> The idea is: If I can programmatically build a complex nested control
> (eg Lables inside HBox, which are inturn inside VBox which can have a
> variety of different sibling controls)and then send it to the print
> to SUCCESSFULLY print, I would save a lotof work and maintenance
> issues in the long run.

You can create it at runtime.

   var myPrintableView = PopUpManager.createPopUp(this, VBox, false);
   myPrintableView.visible = false;

   var hbox = myPrintableView.createChild(HBox, "", {});
   var label1 = hbox.createChild(Label, "", {text: "Address:"});

... and so on.  Then you send 'myPrintableView' to printing.

Manish


Reply via email to