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. 

Reply via email to