Yes it looks strange!
But what type of content-type are you passing as a parameter?
"application/octet-stream", or "application/pdf"?
And what about the file name (downloadFileName)? Try something like
"*******.pdf"
Well I hope It can help.
Ismael.
> Date: Tue, 6 Nov 2007 08:19:08 -0800> From: [EMAIL PROTECTED]> To:
> [email protected]> Subject: [iText-questions] Streaming
> PDF from servlet problem> > > Strange problem, I use the following method to
> stream a pdf to a browser> > private void
> streamToDownload(HttpServletResponse response,> ByteArrayOutputStream baos,
> String contentType,> String downloadFileName) throws ServletException> {>
> try> {> ServletOutputStream servletOutputStream =>
> response.getOutputStream();> byte[] bytes = baos.toByteArray();>
> servletOutputStream.write(bytes, 0, bytes.length);>
> response.setContentType(contentType);>
> response.setHeader("content-disposition", "attachment;> filename=" +
> downloadFileName);> response.setContentLength(bytes.length);>
> servletOutputStream.flush();> servletOutputStream.close();> }> catch
> (IOException e)> {> throw new ServletException(e);> }> }> > > It works fine,
> the user is prompted to save or open the file in the default> application.> >
> However; this is the weird part, as soon as an image is added to the PDF, or>
> another PDF is used as a background for the PDF created with iText, the pdf>
> opens in the browser, not at all the behaviour I want.> > Is there something
> about images or PDFs that "over rides" the content> dispostion? That doesn't
> make sense, but if I had an explantion for this> behaviour I wouldn't be
> posting here right?> > Thanks for any help> > -- > View this message in
> context:
> http://www.nabble.com/Streaming-PDF-from-servlet-problem-tf4759225.html#a13610196>
> Sent from the iText - General mailing list archive at Nabble.com.> > >
> ------------------------------------------------------------------------->
> This SF.net email is sponsored by: Splunk Inc.> Still grepping through log
> files to find problems? Stop.> Now Search log events and configuration files
> using AJAX and a browser.> Download your FREE copy of Splunk now >>
> http://get.splunk.com/> _______________________________________________>
> iText-questions mailing list> [email protected]>
> https://lists.sourceforge.net/lists/listinfo/itext-questions> Buy the iText
> book: http://itext.ugent.be/itext-in-action/
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/