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: <servlet> <servlet-name>SimplePdf</servlet-name> <servlet-class>samples.SimplePdf</servlet-class> </servlet> <servlet-mapping> <servlet-name>SimplePdf</servlet-name> <url-pattern>/servlet/simplePdf.pdf</url-pattern> </servlet-mapping> 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: [email protected] 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: [email protected] 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: [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 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 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns=3D"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"><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2900.2523" name=3DGENERATOR><!--[if !mso]> <STYLE>v\:* { BEHAVIOR: url(#default#VML) } o\:* { BEHAVIOR: url(#default#VML) } w\:* { BEHAVIOR: url(#default#VML) } .shape { BEHAVIOR: url(#default#VML) } </STYLE> <![endif]--> <STYLE>@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-DECORATION: underline } A:visited { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlinkFollowed { COLOR: blue; TEXT-DECORATION: underline } TT { FONT-FAMILY: "Courier New" } SPAN.EmailStyle18 { COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply } DIV.Section1 { page: Section1 } OL { MARGIN-BOTTOM: 0in } UL { MARGIN-BOTTOM: 0in } </STYLE> </HEAD> <BODY lang=3DEN-US vLink=3Dblue link=3Dblue> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff size= =3D2><SPAN=20 class=3D359271502-03032005>Hi Tracy,</SPAN></FONT></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff size= =3D2><SPAN=20 class=3D359271502-03032005></SPAN></FONT> </DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff size= =3D2><SPAN=20 class=3D359271502-03032005>Not a problem. Yes, my printing needs are = quite=20 modest aswell and like I said in the original email, this solution exceeds = my=20 printing needs at the moment, but offeres the flexibility I=20 need.</SPAN></FONT></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff size= =3D2><SPAN=20 class=3D359271502-03032005></SPAN></FONT> </DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff size= =3D2><SPAN=20 class=3D359271502-03032005>Please find attached a simple mxml file as well = as a=20 java file which will need to be compiled.</SPAN></FONT></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff size= =3D2><SPAN=20 class=3D359271502-03032005></SPAN></FONT> </DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff size= =3D2><SPAN=20 class=3D359271502-03032005></SPAN></FONT><FONT face=3D"Courier New" color= =3D#0000ff=20 size=3D2><SPAN class=3D359271502-03032005>Add the servlet and servlet mappi= ng to the=20 web.xml file as below:</SPAN></FONT></DIV> <DIV dir=3Dltr align=3Dleft><FONT face=3D"Courier New" color=3D#0000ff=20 size=3D2></FONT> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D359271502-03032005><FONT face=3D"= Courier New"=20 color=3D#0000ff size=3D2> =20 <servlet><BR> =20 <servlet-name>SimplePdf</servlet-name><BR> &nb= sp; =20 <servlet-class>samples.SimplePdf</servlet-class><BR>  = ; =20 </servlet></FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D359271502-03032005><FONT face=3D"= Courier New"=20 color=3D#0000ff size=3D2></FONT></SPAN> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D359271502-03032005><FONT face=3D"= Courier New"=20 color=3D#0000ff size=3D2> =20 <servlet-mapping><BR> =20 <servlet-name>SimplePdf</servlet-name><BR> &nb= sp; =20 <url-pattern>/servlet/simplePdf.pdf</url-pattern><BR> &nbs= p; =20 </servlet-mapping></FONT></SPAN></DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2>You will also need to download the latest iText jar (itext-1.2.jar= ) and=20 add this to the lib directory along with servlet.jar</FONT></SPAN></DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2>I hope this helps with your printing needs, so enjoy and have fun = with=20 the iText library.</FONT></SPAN></DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2></FONT></SPAN> </DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2>Regards</FONT></SPAN></DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2>Mark</FONT></SPAN></DIV> <DIV><SPAN class=3D359271502-03032005><FONT face=3D"Courier New" color=3D#0= 000ff=20 size=3D2><FONT color=3D#000000></FONT> </DIV> <DIV dir=3Dltr align=3Dleft></FONT></SPAN> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> Tracy Spratt=20 [mailto:[EMAIL PROTECTED] <BR><B>Sent:</B> Thursday, 3 March 2005 9:25= =20 AM<BR><B>To:</B> [email protected]<BR><B>Subject:</B> RE: [flexcod= ers]=20 Re: Advanced Printing Question<BR></FONT><BR></DIV> <DIV></DIV> <DIV class=3DSection1> <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Mark, I’d = love to see a=20 simple working example of this.<o:p></o:p></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p= ></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Luckily, my prin= ting=20 needs at the moment are modest, but an interim solution, while MM improves= =20 native printing, would be a delight.<o:p></o:p></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p= ></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">Tracy<o:p></o:p>= </SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3DArial color=3Dnavy size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"><o:p> </o:p= ></SPAN></FONT></P> <DIV> <DIV class=3DMsoNormal style=3D"TEXT-ALIGN: center" align=3Dcenter><FONT=20 face=3D"Times New Roman" size=3D3><SPAN style=3D"FONT-SIZE: 12pt"> <HR tabIndex=3D-1 align=3Dcenter width=3D"100%" SIZE=3D2> </SPAN></FONT></DIV> <P class=3DMsoNormal><B><FONT face=3DTahoma size=3D2><SPAN=20 style=3D"FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SP= AN></FONT></B><FONT=20 face=3DTahoma size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"= > Mark=20 Hitchcock [mailto:[EMAIL PROTECTED] <BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, March 02, 2005 8:06= =20 PM<BR><B><SPAN style=3D"FONT-WEIGHT: bold">To:</SPAN></B>=20 [email protected]<BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Subject:</SPAN></B> RE: [flexcoders] Re: Advanc= ed=20 Printing Question</SPAN></FONT><o:p></o:p></P></DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Courier New" color=3Dblue size=3D2><SPAN= =20 style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">I have a= lso had=20 a number of problems with support for printing in Flex so I started to look= =20 outside of Flex for a solution. There are probably a number 3rd party= =20 tools that you could try however as I am more comfortable with Java and Fle= x is=20 running in a Java app server anyway, I have implemented a solution that wor= ks=20 very well for what I am trying to achieve with iText. iText is a free= Java=20 PDF library and can be found here <A=20 href=3D"http://www.lowagie.com/iText/">http://www.lowagie.com/iText/</A>&nb= sp;=20 this has also been ported to .NET if anyone is interested in=20 that.</SPAN></FONT><o:p></o:p></P> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Courier New" color=3Dblue size=3D2><SPAN= =20 style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">The way = I have=20 integrated this with Flex is via a Servlet and then using the getURL method= in=20 Flex. This dynamically creates a pdf every time the servlet is=20 called. I am able to add headers, footers, images, tables etc, and th= e=20 list goes on.</SPAN></FONT><o:p></o:p></P> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Courier New" color=3Dblue size=3D2><SPAN= =20 style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">I'm not = sure if=20 this will meet everyone's needs or how support for printing in Flex will im= prove=20 with future releases of Flex, however this meets and exceeds the printing n= eeds=20 of what I need to do. If anyone is interested in a working example, j= ust=20 let me know and I will post a simple example I have working. If= =20 anyone from MM has looked into this or has any comments on using iText that= =20 would be great also.</SPAN></FONT><o:p></o:p></P> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P> <P class=3DMsoNormal><FONT face=3D"Courier New" color=3Dblue size=3D2><SPAN= =20 style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">Regards<= /SPAN></FONT><o:p></o:p></P> <P class=3DMsoNormal><FONT face=3D"Courier New" color=3Dblue size=3D2><SPAN= =20 style=3D"FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">Mark=20 Hitchcock</SPAN></FONT><o:p></o:p></P> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P> <DIV> <P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20 style=3D"FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV> <DIV class=3DMsoNormal style=3D"TEXT-ALIGN: center" align=3Dcenter><FONT=20 face=3D"Times New Roman" size=3D3><SPAN style=3D"FONT-SIZE: 12pt"> <HR tabIndex=3D-1 align=3Dcenter width=3D"100%" SIZE=3D2> </SPAN></FONT></DIV> <P class=3DMsoNormal style=3D"MARGIN-BOTTOM: 12pt"><B><FONT face=3DTahoma s= ize=3D2><SPAN=20 style=3D"FONT-WEIGHT: bold; FONT-SIZE: 10pt; FONT-FAMILY: Tahoma">From:</SP= AN></FONT></B><FONT=20 face=3DTahoma size=3D2><SPAN style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Tahoma"= > Manish=20 Jethani [mailto:[EMAIL PROTECTED] <BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Sent:</SPAN></B> Wednesday, 2 March 2005 12:42= =20 AM<BR><B><SPAN style=3D"FONT-WEIGHT: bold">To:</SPAN></B>=20 [email protected]<BR><B><SPAN=20 style=3D"FONT-WEIGHT: bold">Subject:</SPAN></B> Re: [flexcoders] Re: Advanc= ed=20 Printing Question</SPAN></FONT><o:p></o:p></P> <P class=3DMsoNormal><TT><FONT face=3D"Courier New" size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt">AC wrote:</SPAN></FONT></TT><FONT face=3D"Courier= New"=20 size=3D2><SPAN=20 style=3D"FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"><BR><BR><TT><FONT=20 face=3D"Courier New">> The idea is: If I can programmatically build a co= mplex=20 nested control</FONT></TT><BR><TT><FONT face=3D"Courier New">> (eg Lable= s=20 inside HBox, which are in turn inside VBox which can have=20 a</FONT></TT><BR><TT><FONT face=3D"Courier New">> variety of different s= ibling=20 controls) and then send it to the print</FONT></TT><BR><TT><FONT=20 face=3D"Courier New">> to SUCCESSFULLY print, I would save a lot of work= and=20 maintenance</FONT></TT><BR><TT><FONT face=3D"Courier New">> issues in th= e long=20 run.</FONT></TT><BR><BR><TT><FONT face=3D"Courier New">You can create it at= =20 runtime.</FONT></TT><BR><BR><TT><FONT face=3D"Courier New"> var= =20 myPrintableView =3D PopUpManager.createPopUp(this, VBox,=20 false);</FONT></TT><BR><TT><FONT face=3D"Courier New"> =20 myPrintableView.visible =3D false;</FONT></TT><BR><BR><TT><FONT=20 face=3D"Courier New"> var hbox =3D myPrintableView.createChild(= HBox, "",=20 {});</FONT></TT><BR><TT><FONT face=3D"Courier New"> var label1 = =3D=20 hbox.createChild(Label, "", {text: "Address:"});</FONT></TT><BR><BR><TT><FO= NT=20 face=3D"Courier New">... and so on. Then you send 'myPrintableView' t= o=20 printing.</FONT></TT><BR><BR><TT><FONT=20 face=3D"Courier New">Manish</FONT></TT><BR><BR></SPAN></FONT><BR><BR><BR><o= :p></o:p></P><BR></DIV></BODY></HTML> ------=_NextPart_001_002D_01C51FDE.A3429E20--
binvciuFLzVUh.bin
Description: Binary data
binD9FhbC8Z6O.bin
Description: Binary data

