xmlgraphics-fop-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex McLintock <ale...@yahoo.com>
Subject Re: PDF display problem in IE5.5 and Netscape6.0
Date Thu, 05 Apr 2001 08:34:12 GMT
I could have sworn this was in the FAQ. Oh well never mind.

-->>
http://www.owal.co.uk:8090/asf/servlet/asf/screen/DisplayQuestionAnswer/action/SetAll/project_id/18/faq_id/276/topic_id/496/question_id/802
<<--


I think your problem is that you are rendering straight to the servlet's 
response output stream. This means that IE can't tell how big the PDF is
but knows it is a PDF so Adobe Acrobat gets launched.


try putting the PDF in a buffer, setting the response content size to the 
size of the PDF and *then* streaming the pdf to the response's output stream.

If this isn't detailed enough for you I think the author of IText explains
it clearly in his FAQ http://www.lowagie.com/iText/ 


Dunno about Netscape 6 I am afraid.

Alex

--- Marina Shirshova <mshirshova@hsx.com> wrote:
> Hello All,
> 
> I know this is not a new problem and there are quite a few posts out there
> regarding pdf's not displaying in IE5.5.  However, I could not find any
> solution that would help me.
> 
> In a nutshell:
> 
> I have a servlet that generates a pdf file and sends it to a client in a
> stream.  This works fine in all the browsers except IE5.5, which do runs the
> Acrobat Reader trailer but does not display anything.
> 
> ======
> 
> Here is the code excerpt:
> 
> 
> //transform xml into pdf using predefined xsl file:
> InputStream in_stream = my_result.getXMLInputStream();
> String xsl_file_name = my_result.getFoFileName();
> ByteArrayOutputStream baos = new ByteArrayOutputStream();
> XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
> processor.reset();
> StylesheetRoot style = processor.processStylesheet(new
> XSLTInputSource(xsl_file_name));
> processor.setStylesheet(style);
> XSLTResultTarget outBuffer = new XSLTResultTarget(baos);
> processor.process(new XSLTInputSource(in_stream),null,outBuffer);
> in_stream.close();
> in_stream = new ByteArrayInputStream(baos.toByteArray());
> baos.flush();
> baos.close();
> 
> //render the resulting pdf on the client browser
> Driver driver = new Driver();
> driver.setErrorDump(HMRProperties.FOP_ERROR_DUMP);
> driver.setRenderer("org.apache.fop.render.pdf.PDFRenderer",
> Version.getVersion());
> driver.addElementMapping("org.apache.fop.fo.StandardElementMapping");
> driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
> driver.addPropertyList("org.apache.fop.fo.StandardPropertyListMapping");
> driver.addPropertyList("org.apache.fop.svg.SVGPropertyListMapping");
> XMLReader parser = this.createSAXParser();
> driver.buildFOTree(parser, new InputSource(in_stream));
> driver.format();
> response.setContentType("application/pdf");
> OutputStream out = response.getOutputStream();
> driver.setOutputStream(out);
> driver.render();
> in_stream.
> out.flush();
> out.close();
> in_stream.close();
> response.flushBuffer();
> 
> =======
> 
> Here is my set-up:
> Weblogic5.1 app server
> Apache 1.1.12 web server
> FOP 0.17.0
> xalan-j_1_2_2
> 
> =======
> 
> Thank you very much for your help.
> 
> Marina Shirshova
> mshirshova@hsx.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org
> 


=====
Alex McLintock        alex@OWAL.co.uk

OpenWeb Analysts Ltd, http://www.OWAL.co.uk/
Software for Complex Websites.

Publisher of       http://www.DiverseBooks.com
                   http://www.galactic-guide.com/

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Mime
View raw message