Interesting problem! (as fas as the empty browser window after requested pdf data is sent back to the browser is concerned)
These may be the problems I have noticed in my test environment. PDF generation code worked till last test and suddenly not any more although code was not modified concering the PDF generation... there has been a browser update since that! my test url entered in the browser was http://localhost:8080/fopwelcomeservlet?xml=/c:/XML_SPACE/form_lohnsteuer_sa mpledata_without_dtd_ref.xml&xsl=/c:/XML_SPACE/form_lohnsteuer_fo.xsl&fo=/c: /XML_SPACE/testdata.fo internet explorer versions do match (also IE 5.5 used on test client) fop version 2.20.2 server is tomcat version used by jbuilder 5 I had not time to check the details of this problem yet und I may not be able to do that before monday but it would nice to keep each other up to date... I think it should >>NOT<< be necessary to code a workaround like you proposed, even if it may work the way you say. Regards, Michael -----Urspr�ngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 15. Februar 2002 17:17 An: [EMAIL PROTECTED] Betreff: Re: FOP and servlets No, it's not the solution. In fact, my code is good but my browser is I.E. 5.5 and there's a bug with I.E. when you request a servlet with a URL that ends with .xml or .xsl : it considers that the servlet sends back a xml response. To display the generated PDF, I have to add a parameter that does not end with .xml or .xsl (for instance dummy=.pdf)in the URL. Thanks for your response, either. JD. > application/x-pdf, not application/pdf > > [EMAIL PROTECTED] wrote: > > Hi, > > > > I've been using FOP for a few days and i have a problem with displaying PDF through a browser with FOP. I'm using FOP 0.20.1 with Xalan 1.2 and Xerces 1.2. Here's a sample of my servlet source : > > > > String xmlString = request.getParameter("XML"); > > String xslString = resquest.getParameter("XSL"); > > ByteArrayOutputStream fo = new ByteArrayOutputStream(); > > //XSLT transformation > > XSLTProcessor lProcessor = XSLTProcessorFactory.getProcessor(); > > lProcessor.process(new XSLTInputSource(new StringReader(xmlString)), new XSLTInputSource(new StringReader(xslString), new XLSTResultTarget(fo)); > > // PDF generation with FOP > > Driver lFOPDriver = new Driver(); > > InputSource FOSource = new InputSource(fo); > > response.setContentType("application/pdf"); > > ServletOutputStream output = response.getOutputStream(); > > lFOPDriver.setOutputStream(output); > > lFOPDriver.setRenderer(RENDER_PDF); > > XMLReader reader = (XMLReader) Class.forName("org.apache.xerces.parsers.SAXParser").newInstance(); > > lFOPDriver.setXmlReader(reader); > > lFOPDriver.setInputSource(FOSource); > > lFOPDriver.run(); > > output.flush(); > > output.close(); > > > > When I call this servlet, the browser don't display the generated PDF but I 've noticed that it appears in my Temporary Internet Files. > > > > Does anyone have an idea ? > > > > Regards. > > > > JD. > > ____________________________________________________________ > > Faites un voeu et puis Voila ! www.voila.fr > > Avec Voila Mail, consultez vos e-mails sur votre mobile Wap. > > > > > ____________________________________________________________ Faites un voeu et puis Voila ! www.voila.fr Avec Voila Mail, consultez vos e-mails sur votre mobile Wap.
