You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Ry...@stpaul.com on 2002/04/16 16:28:15 UTC

PDF Plugin Launch

Hello,

I am using FOP embedded in a servlet.  I use the following two lines to
inform the browser that the result stream is a PDF file:


response.setContentType("application/pdf");
response.setHeader("Content-disposition", "attachment; filename
=\"report.pdf\"");


Upon receiving the PDF file, Internet Explorer will launch the File
Download dialog that asks "What would you like to do with this file?" with
the options being Save or Open.

This is not the behavior I want.  I want Internet Explorer to simply launch
the Acrobat plugin to view the PDF within the context of the browser.  This
is what IE does if there is simply a link in the HTML that points to
"file.pdf."  Coincidentally, Mozilla launches the plugin to view the PDF,
as desired.

How can I set the content type and/or the header so that IE launches the
Acrobat plugin rather than saving the PDF to file or launching Acrobat
externally?




Re: PDF Plugin Launch

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Ryan.Asleson@stpaul.com wrote:
> I want Internet Explorer to simply launch
> the Acrobat plugin to view the PDF within the context of the browser. 

The behaviour of IEx varies from version to version.
You could do:
1. Use a URL which ends in .pdf:
     http://my.server/some/path/to/file.pdf
  Yes, you can build your servlet so that your URLs
  look as if they point to static files. This may,
  of course, require a major redesign of your site
  structure. Nevertheless this is the only known
  way to get always what you want.
2. Append a dummy parameter:
     http://my.server/servlet?e=.pdf
  This will only work reliably if your base URL
  does not end in a registered extension (on the
  machine where the browser runs!)

In either case, set the content type to application/pdf

J.Pietschmann