The problem is almost certainly with your setHeader
or setContentType statements..
make sure u r not
setting <in setHeader> Content-Type to application or octet-stream
Content-Disposition to attachment
which will force a download...
-----Original Message-----
From: Peter Indelicato [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 26, 2001 4:30 AM
Subject: Opening PDF automatically in IE

Hello Everyone.

Im pretty new to FOP, so I apologize if the answer to this question is well known or off-topic. 

Im creating a .fo file that renders fine using the FOP engine command-line/stand alone, but when the response is sent to the browser, the users is prompted to download a file (with a random, meaningless name, of type PDF) instead of IE opening and displaying the PDF file automatically.  I know this is possible on my browser b/c I have other PDF servlets (that dont use FOP) that DONT prompt for the download.  Heres the broken code:

private void renderFO(InputSource foFile, HttpServletResponse response) throws
            java.io.OutputStream os = response.getOutputStream();

   ByteArrayOutputStream out = new ByteArrayOutputStream();
            response.setHeader("Content-disposition", "filename=report.pdf");
   response.setHeader("Etag", "\"irise-" + System.currentTimeMillis() + "\"");
   response.setHeader("Accept-Ranges", "bytes");
   Driver driver = new Driver(foFile, out);

   byte[] content = out.toByteArray();
System.out.println("content length: " + content.length);
  catch (Exception e)
   throw new javax.servlet.ServletException(e);

Please help!  Much appreciated.


Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger.
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to