RE: FOP embedding
So, I have the problem (Huston). I take my code (xsl) and rewriter in for all those lines. > -Mensaje original- > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > Enviado el: miércoles, 06 de marzo de 2002 15:57 > Para: [EMAIL PROTECTED] > Asunto: RE: FOP embedding > > Yes. Here is the beginning of one of our xsl files: > > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; > xmlns:fo="http://www.w3.org/1999/XSL/Format";> > > > > > page-height="8.5in" > page-width="11in" > margin-top=".25in" > margin-bottom=".25in" > margin-left=".25in" > margin-right=".25in"> > > > > > > > > Jim > > > -----Original Message- > > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 06, 2002 12:33 PM > > To: [EMAIL PROTECTED] > > Subject: RE: FOP embedding > > > > > > Jim > > > > Are your file foXslFile.xsl have code ? > > > > > -Mensaje original- > > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > > Enviado el: miércoles, 06 de marzo de 2002 13:52 > > > Para: [EMAIL PROTECTED] > > > Asunto: RE: FOP embedding > > > > > > public void doPost(HttpServletRequest req, HttpServletResponse res) > > >throws ServletException > > > { > > > ... your code > > > try > > > { > > > String xmlString = new String(""); // your xml > > > TransformerFactory tFactory = > > > TransformerFactory.newInstance(); > > > File foFile= new File("foXslFile.xsl"); > > > Source foXslSource = new StreamSource(foFile); > > > Transformer pdfTransformer = > > > tFactory.newTransformer(foXslSource); > > > Writer out = new StringWriter(); > > > Source xmlSource = new StreamSource(new > > > StringReader(xmlString)); > > > pdfTransformer.transform(xmlSource, new StreamResult(out)); > > > out.close(); > > > String fopstring = out.toString(); > > > InputSource foSource = new InputSource(new > > > StringReader(fopstring)); > > > renderFO(foSource, req, res, inPdf); > > > ByteArrayOutputStream baout = new ByteArrayOutputStream(); > > > Driver driver = new Driver(foSource , baout); > > > res.setContentType("application/pdf"); > > > driver.setRenderer(Driver.RENDER_PDF); > > > driver.run(); > > > byte[] content = baout.toByteArray(); > > > res.setContentLength(content.length); // This keeps IE > > > happy > > > res.getOutputStream().write(content); > > > res.getOutputStream().flush(); > > > res.flushBuffer(); > > > } > > > catch (Exception e) > > > { > > > System.err.println("Exception in init: " + e.toString()); > > > e.printStackTrace(); > > > } > > > ... more code > > > } > > > > > > > -Original Message- > > > > From: Carlos Daniel Schafer > > [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, March 06, 2002 10:28 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: RE: FOP embedding > > > > > > > > > > > > I'm sorry > > > > > > > > Do you want to use FOP in a servlet to produce a PDF from > > > > dynamically created XML and return the PDF to the > > > > browser to display? > > > > > > > > Yes > > > > > > > > I have this files (FOP). > > > > > > > > I have code this servlet with created XML and I desidere > dynamically > > > > return the PDF. > > > > > > > > Do you want send this servlet for look? > > > > > > > > > > > > > > > > > -Mensaje original- > > > > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > > > > Enviado el: miércoles, 06 de marzo de 2002 13:05 > > > > >
RE: FOP embedding
Yes. Here is the beginning of one of our xsl files: http://www.w3.org/1999/XSL/Transform"; xmlns:fo="http://www.w3.org/1999/XSL/Format";> Jim > -Original Message- > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 06, 2002 12:33 PM > To: [EMAIL PROTECTED] > Subject: RE: FOP embedding > > > Jim > > Are your file foXslFile.xsl have code ? > > > -Mensaje original- > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > Enviado el: miércoles, 06 de marzo de 2002 13:52 > > Para: [EMAIL PROTECTED] > > Asunto: RE: FOP embedding > > > > public void doPost(HttpServletRequest req, HttpServletResponse res) > > throws ServletException > > { > > ... your code > > try > > { > > String xmlString = new String(""); // your xml > > TransformerFactory tFactory = > > TransformerFactory.newInstance(); > > File foFile= new File("foXslFile.xsl"); > > Source foXslSource = new StreamSource(foFile); > > Transformer pdfTransformer = > > tFactory.newTransformer(foXslSource); > > Writer out = new StringWriter(); > > Source xmlSource = new StreamSource(new > > StringReader(xmlString)); > > pdfTransformer.transform(xmlSource, new StreamResult(out)); > > out.close(); > > String fopstring = out.toString(); > > InputSource foSource = new InputSource(new > > StringReader(fopstring)); > > renderFO(foSource, req, res, inPdf); > > ByteArrayOutputStream baout = new ByteArrayOutputStream(); > > Driver driver = new Driver(foSource , baout); > > res.setContentType("application/pdf"); > > driver.setRenderer(Driver.RENDER_PDF); > > driver.run(); > > byte[] content = baout.toByteArray(); > > res.setContentLength(content.length); // This keeps IE > > happy > > res.getOutputStream().write(content); > > res.getOutputStream().flush(); > > res.flushBuffer(); > > } > > catch (Exception e) > > { > > System.err.println("Exception in init: " + e.toString()); > > e.printStackTrace(); > > } > > ... more code > > } > > > > > -Original Message- > > > From: Carlos Daniel Schafer > [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, March 06, 2002 10:28 AM > > > To: [EMAIL PROTECTED] > > > Subject: RE: FOP embedding > > > > > > > > > I'm sorry > > > > > > Do you want to use FOP in a servlet to produce a PDF from > > > dynamically created XML and return the PDF to the > > > browser to display? > > > > > > Yes > > > > > > I have this files (FOP). > > > > > > I have code this servlet with created XML and I desidere dynamically > > > return the PDF. > > > > > > Do you want send this servlet for look? > > > > > > > > > > > > > -Mensaje original- > > > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > > > Enviado el: miércoles, 06 de marzo de 2002 13:05 > > > > Para: [EMAIL PROTECTED] > > > > Asunto: RE: FOP embedding > > > > > > > > Can you please be more specific. Do you want to use FOP in > a servlet > > to > > > produce a PDF from dynamically created XML and return the PDF to > > > the > > > browser to display? Are you having problems writing the Java code > > > to do > > > > this, or are you having problems with FOP not working? > > > > > > > > Jim > > > > > -Original Message- > > > > > From: Carlos Daniel Schafer > > [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, March 06, 2002 9:34 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: FOP embedding > > > > > > > > > > > > Hi! > > > > > > > > I saw those examples the FOP > > > > I have problem with transformer XML to PDF from a servlet. How I to > > do? > > > > > > > > > > > > > > > > > -
RE: FOP embedding
Jim Are your file foXslFile.xsl have code ? > -Mensaje original- > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > Enviado el: miércoles, 06 de marzo de 2002 13:52 > Para: [EMAIL PROTECTED] > Asunto: RE: FOP embedding > > public void doPost(HttpServletRequest req, HttpServletResponse res) >throws ServletException > { > ... your code > try > { > String xmlString = new String(""); // your xml > TransformerFactory tFactory = > TransformerFactory.newInstance(); > File foFile= new File("foXslFile.xsl"); > Source foXslSource = new StreamSource(foFile); > Transformer pdfTransformer = > tFactory.newTransformer(foXslSource); > Writer out = new StringWriter(); > Source xmlSource = new StreamSource(new > StringReader(xmlString)); > pdfTransformer.transform(xmlSource, new StreamResult(out)); > out.close(); > String fopstring = out.toString(); > InputSource foSource = new InputSource(new > StringReader(fopstring)); > renderFO(foSource, req, res, inPdf); > ByteArrayOutputStream baout = new ByteArrayOutputStream(); > Driver driver = new Driver(foSource , baout); > res.setContentType("application/pdf"); > driver.setRenderer(Driver.RENDER_PDF); > driver.run(); > byte[] content = baout.toByteArray(); > res.setContentLength(content.length); // This keeps IE > happy > res.getOutputStream().write(content); > res.getOutputStream().flush(); > res.flushBuffer(); > } > catch (Exception e) > { > System.err.println("Exception in init: " + e.toString()); > e.printStackTrace(); > } > ... more code > } > > > -Original Message- > > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 06, 2002 10:28 AM > > To: [EMAIL PROTECTED] > > Subject: RE: FOP embedding > > > > > > I'm sorry > > > > Do you want to use FOP in a servlet to produce a PDF from > > dynamically created XML and return the PDF to the > > browser to display? > > > > Yes > > > > I have this files (FOP). > > > > I have code this servlet with created XML and I desidere dynamically > > return the PDF. > > > > Do you want send this servlet for look? > > > > > > > > > -Mensaje original- > > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > > Enviado el: miércoles, 06 de marzo de 2002 13:05 > > > Para: [EMAIL PROTECTED] > > > Asunto: RE: FOP embedding > > > > > > Can you please be more specific. Do you want to use FOP in a servlet > to > > produce a PDF from dynamically created XML and return the PDF to > > the > > browser to display? Are you having problems writing the Java code > > to do > > > this, or are you having problems with FOP not working? > > > > > > Jim > > > > -Original Message- > > > > From: Carlos Daniel Schafer > [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, March 06, 2002 9:34 AM > > > To: [EMAIL PROTECTED] > > > Subject: FOP embedding > > > > > > > > > Hi! > > > > > > I saw those examples the FOP > > > I have problem with transformer XML to PDF from a servlet. How I to > do? > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, email: [EMAIL PROTECTED] > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, email: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: FOP embedding
Sorry, it was a cut and paste error. Remove that line of code. Jim > -Original Message- > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 06, 2002 11:13 AM > To: [EMAIL PROTECTED] > Subject: RE: FOP embedding > > > Sorry > > Is this renderFO a method(param1, param2, param3, param4)? > Because, I don't found. > > So, what is import libraries but the servlet? > > > > > -Mensaje original- > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > Enviado el: miércoles, 06 de marzo de 2002 13:52 > > Para: [EMAIL PROTECTED] > > Asunto: RE: FOP embedding > > > > public void doPost(HttpServletRequest req, HttpServletResponse res) > > throws ServletException > > { > > ... your code > > try > > { > > String xmlString = new String(""); // your xml > > TransformerFactory tFactory = > > TransformerFactory.newInstance(); > > File foFile= new File("foXslFile.xsl"); > > Source foXslSource = new StreamSource(foFile); > > Transformer pdfTransformer = > > tFactory.newTransformer(foXslSource); > > Writer out = new StringWriter(); > > Source xmlSource = new StreamSource(new > > StringReader(xmlString)); > > pdfTransformer.transform(xmlSource, new StreamResult(out)); > > out.close(); > > String fopstring = out.toString(); > > InputSource foSource = new InputSource(new > > StringReader(fopstring)); > > renderFO(foSource, req, res, inPdf); > > ByteArrayOutputStream baout = new ByteArrayOutputStream(); > > Driver driver = new Driver(foSource , baout); > > res.setContentType("application/pdf"); > > driver.setRenderer(Driver.RENDER_PDF); > > driver.run(); > > byte[] content = baout.toByteArray(); > > res.setContentLength(content.length); // This keeps IE > > happy > > res.getOutputStream().write(content); > > res.getOutputStream().flush(); > > res.flushBuffer(); > > } > > catch (Exception e) > > { > > System.err.println("Exception in init: " + e.toString()); > > e.printStackTrace(); > > } > > ... more code > > } > > > > > -Original Message- > > > From: Carlos Daniel Schafer > [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, March 06, 2002 10:28 AM > > > To: [EMAIL PROTECTED] > > > Subject: RE: FOP embedding > > > > > > > > > I'm sorry > > > > > > Do you want to use FOP in a servlet to produce a PDF from > > > dynamically created XML and return the PDF to the > > > browser to display? > > > > > > Yes > > > > > > I have this files (FOP). > > > > > > I have code this servlet with created XML and I desidere dynamically > > > return the PDF. > > > > > > Do you want send this servlet for look? > > > > > > > > > > > > > -Mensaje original- > > > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > > > Enviado el: miércoles, 06 de marzo de 2002 13:05 > > > > Para: [EMAIL PROTECTED] > > > > Asunto: RE: FOP embedding > > > > > > > > Can you please be more specific. Do you want to use FOP in > a servlet > > to > > > produce a PDF from dynamically created XML and return the PDF to > > > the > > > browser to display? Are you having problems writing the Java code > > > to do > > > > this, or are you having problems with FOP not working? > > > > > > > > Jim > > > > > -Original Message- > > > > > From: Carlos Daniel Schafer > > [mailto:[EMAIL PROTECTED]] > > > > Sent: Wednesday, March 06, 2002 9:34 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: FOP embedding > > > > > > > > > > > > Hi! > > > > > > > > I saw those examples the FOP > > > > I have problem with transformer XML to PDF from a servlet. How I to > > do? > > > > > > > > > > > > > > > > > - > > > > To unsu
RE: FOP embedding
Sorry Is this renderFO a method(param1, param2, param3, param4)? Because, I don't found. So, what is import libraries but the servlet? > -Mensaje original- > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > Enviado el: miércoles, 06 de marzo de 2002 13:52 > Para: [EMAIL PROTECTED] > Asunto: RE: FOP embedding > > public void doPost(HttpServletRequest req, HttpServletResponse res) >throws ServletException > { > ... your code > try > { > String xmlString = new String(""); // your xml > TransformerFactory tFactory = > TransformerFactory.newInstance(); > File foFile= new File("foXslFile.xsl"); > Source foXslSource = new StreamSource(foFile); > Transformer pdfTransformer = > tFactory.newTransformer(foXslSource); > Writer out = new StringWriter(); > Source xmlSource = new StreamSource(new > StringReader(xmlString)); > pdfTransformer.transform(xmlSource, new StreamResult(out)); > out.close(); > String fopstring = out.toString(); > InputSource foSource = new InputSource(new > StringReader(fopstring)); > renderFO(foSource, req, res, inPdf); > ByteArrayOutputStream baout = new ByteArrayOutputStream(); > Driver driver = new Driver(foSource , baout); > res.setContentType("application/pdf"); > driver.setRenderer(Driver.RENDER_PDF); > driver.run(); > byte[] content = baout.toByteArray(); > res.setContentLength(content.length); // This keeps IE > happy > res.getOutputStream().write(content); > res.getOutputStream().flush(); > res.flushBuffer(); > } > catch (Exception e) > { > System.err.println("Exception in init: " + e.toString()); > e.printStackTrace(); > } > ... more code > } > > > -Original Message- > > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 06, 2002 10:28 AM > > To: [EMAIL PROTECTED] > > Subject: RE: FOP embedding > > > > > > I'm sorry > > > > Do you want to use FOP in a servlet to produce a PDF from > > dynamically created XML and return the PDF to the > > browser to display? > > > > Yes > > > > I have this files (FOP). > > > > I have code this servlet with created XML and I desidere dynamically > > return the PDF. > > > > Do you want send this servlet for look? > > > > > > > > > -Mensaje original- > > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > > Enviado el: miércoles, 06 de marzo de 2002 13:05 > > > Para: [EMAIL PROTECTED] > > > Asunto: RE: FOP embedding > > > > > > Can you please be more specific. Do you want to use FOP in a servlet > to > > produce a PDF from dynamically created XML and return the PDF to > > the > > browser to display? Are you having problems writing the Java code > > to do > > > this, or are you having problems with FOP not working? > > > > > > Jim > > > > -Original Message- > > > > From: Carlos Daniel Schafer > [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, March 06, 2002 9:34 AM > > > To: [EMAIL PROTECTED] > > > Subject: FOP embedding > > > > > > > > > Hi! > > > > > > I saw those examples the FOP > > > I have problem with transformer XML to PDF from a servlet. How I to > do? > > > > > > > > > > > > - > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, email: [EMAIL PROTECTED] > > > > > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, email: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: FOP embedding
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException { ... your code try { String xmlString = new String(""); // your xml TransformerFactory tFactory = TransformerFactory.newInstance(); File foFile= new File("foXslFile.xsl"); Source foXslSource = new StreamSource(foFile); Transformer pdfTransformer = tFactory.newTransformer(foXslSource); Writer out = new StringWriter(); Source xmlSource = new StreamSource(new StringReader(xmlString)); pdfTransformer.transform(xmlSource, new StreamResult(out)); out.close(); String fopstring = out.toString(); InputSource foSource = new InputSource(new StringReader(fopstring)); renderFO(foSource, req, res, inPdf); ByteArrayOutputStream baout = new ByteArrayOutputStream(); Driver driver = new Driver(foSource , baout); res.setContentType("application/pdf"); driver.setRenderer(Driver.RENDER_PDF); driver.run(); byte[] content = baout.toByteArray(); res.setContentLength(content.length); // This keeps IE happy res.getOutputStream().write(content); res.getOutputStream().flush(); res.flushBuffer(); } catch (Exception e) { System.err.println("Exception in init: " + e.toString()); e.printStackTrace(); } ... more code } > -Original Message- > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 06, 2002 10:28 AM > To: [EMAIL PROTECTED] > Subject: RE: FOP embedding > > > I'm sorry > > Do you want to use FOP in a servlet to produce a PDF from > dynamically created XML and return the PDF to the > browser to display? > > Yes > > I have this files (FOP). > > I have code this servlet with created XML and I desidere dynamically > return the PDF. > > Do you want send this servlet for look? > > > > > -Mensaje original- > > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > > Enviado el: miércoles, 06 de marzo de 2002 13:05 > > Para: [EMAIL PROTECTED] > > Asunto: RE: FOP embedding > > > > Can you please be more specific. Do you want to use FOP in a servlet to > produce a PDF from dynamically created XML and return the PDF to > the > browser to display? Are you having problems writing the Java code > to do > > this, or are you having problems with FOP not working? > > > > Jim > > > -Original Message- > > > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 06, 2002 9:34 AM > > To: [EMAIL PROTECTED] > > Subject: FOP embedding > > > > > > Hi! > > > > I saw those examples the FOP > > I have problem with transformer XML to PDF from a servlet. How I to do? > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, email: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: FOP embedding
I'm sorry Do you want to use FOP in a servlet to produce a PDF from dynamically created XML and return the PDF to the browser to display? Yes I have this files (FOP). I have code this servlet with created XML and I desidere dynamically return the PDF. Do you want send this servlet for look? > -Mensaje original- > De: Jim Urban [SMTP:[EMAIL PROTECTED]] > Enviado el: miércoles, 06 de marzo de 2002 13:05 > Para: [EMAIL PROTECTED] > Asunto: RE: FOP embedding > > Can you please be more specific. Do you want to use FOP in a servlet to produce a PDF from dynamically created XML and return the PDF to the browser to display? Are you having problems writing the Java code to do > this, or are you having problems with FOP not working? > > Jim > > -Original Message- > > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, March 06, 2002 9:34 AM > > To: [EMAIL PROTECTED] > > Subject: FOP embedding > > > > > > Hi! > > > > I saw those examples the FOP > > I have problem with transformer XML to PDF from a servlet. How I to do? > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, email: [EMAIL PROTECTED] > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
RE: FOP embedding
Can you please be more specific. Do you want to use FOP in a servlet to produce a PDF from dynamically created XML and return the PDF to the browser to display? Are you having problems writing the Java code to do this, or are you having problems with FOP not working? Jim > -Original Message- > From: Carlos Daniel Schafer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 06, 2002 9:34 AM > To: [EMAIL PROTECTED] > Subject: FOP embedding > > > Hi! > > I saw those examples the FOP > I have problem with transformer XML to PDF from a servlet. How I to do? > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, email: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]
FOP embedding
Hi! I saw those examples the FOP I have problem with transformer XML to PDF from a servlet. How I to do? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]