Loading ...
Sorry, an error occurred while loading the content.

2180PDFs direct to browser?

Expand Messages
  • Steve Murphy
    Sep 1, 2002
    • 0 Attachment
      Hi,

      We are trying to modify the FopServlet example to run
      from a JSP. We are not getting the PDF to display
      correctly in browser. We are getting "Error 500:
      no protocol:" followed by the FO source. Also, we
      are calling the JSP directly 'print_response.jsp'.
      Does anyone have any ideas?

      Here's our source code:

      ByteArrayOutputStream outStuff = new
      ByteArrayOutputStream();
      response.setContentType("application/pdf");

      Driver driver = new Driver(is, outStuff);

      Logger logger = null;
      driver.setLogger(logger);

      driver.setRenderer(Driver.RENDER_PDF);
      driver.run();

      byte[] content = outStuff.toByteArray();
      response.setContentLength(content.length);
      response.getOutputStream().write(content);
      response.getOutputStream().flush();

      Thanks

      Steve



      __________________________________________________
      Do You Yahoo!?
      Yahoo! Finance - Get real-time stock quotes
      http://finance.yahoo.com
    • Show all 2 messages in this topic