RE: [flexcoders] Re: Advanced Printing Question
Hi Tracy, Not a problem. Yes, my printing needs are quite modest aswell and like I said in the original email, this solution exceeds my printing needs at the moment, but offeres the flexibility I need. Please find attached a simple mxml file as well as a java file which will need to be compiled. Add the servlet and servlet mapping to the web.xml file as below: SimplePdf samples.SimplePdf SimplePdf /servlet/simplePdf.pdf You will also need to download the latest iText jar (itext-1.2.jar) and add this to the lib directory along with servlet.jar I hope this helps with your printing needs, so enjoy and have fun with the iText library. Regards Mark _ From: Tracy Spratt [mailto:[EMAIL PROTECTED] Sent: Thursday, 3 March 2005 9:25 AM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Advanced Printing Question Mark, I'd love to see a simple working example of this. Luckily, my printing needs at the moment are modest, but an interim solution, while MM improves native printing, would be a delight. Tracy _ From: Mark Hitchcock [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 8:06 PM To: flexcoders@yahoogroups.com Subject: RE: [flexcoders] Re: Advanced Printing Question 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 able to 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 into this 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: flexcoders@yahoogroups.com 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 in turn 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 lot of 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 Yahoo! Groups Sponsor ADVERTISEMENT <http://us.ard.yahoo.com/SIG=129c45eho/M=298184.6018725.7038619.3001176/D=gr oups/S=1705007207:HM/EXP=1109898507/A=2593423/R=0/SIG=11el9gslf/*http://www. netflix.com/Default?mqso=60190075> click here <http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S= :HM/A=2593423/rand=874200691> _ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . --=_NextPart_001_002D_01C51FDE.A3429E20 Content-Type: text/html; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable http://www.w3.org/TR/REC-html40"; xmlns:v =3D=20 "urn:schemas-microsoft-com:vml" xmlns:o =3D=20 "urn:schemas-microsoft-com:office:office" xmlns:w =3D=20 "urn:schemas-microsoft-com:office:word"> @font-face { font-family: Wingdings; } @font-face { font-family: Tahoma; } @page Section1 {size: 8.5in 11.0in; margin: 1.0in 1.25in 1.0in 1.25in; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } LI.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } DIV.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0in 0in 0pt; FONT-FAMILY: "Times New Roman" } A:link { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlink { COLOR: blue; TEXT-DECORA
RE: [flexcoders] Re: Advanced Printing Question
Mark, I’d love to see a simple working example of this. Luckily, my printing needs at the moment are modest, but an interim solution, while MM improves native printing, would be a delight. Tracy From: Mark Hitchcock [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 8:06 PM To: [EMAIL PROTECTED] Subject: RE: [flexcoders] Re: Advanced Printing Question I have alsohad 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 methodin Flex. This dynamically creates a pdf every time the servlet is called. I am able to 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 into this 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 in turn 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 lot of 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
RE: [flexcoders] Re: Advanced Printing Question
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 AMTo: flexcoders@yahoogroups.comSubject: 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
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 in turn 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 lot of 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