cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "depub2" <dep...@mxsi.com>
Subject [FYI] How IE handles PDFs
Date Tue, 29 Mar 2005 22:42:29 GMT
FYI...

How to use FOP in a Servlet

Here's what we did in cocoon:
---------------------------------------------
    <map:pipeline>
      <map:parameter name="expires" value="access plus 20 seconds"/>
      <map:match pattern="PDFstaticcontent/*/*/*.pdf">
        <!--DocDir/ObjName/FileName"-->
        <map:read mime-type="application/pdf"
src="context://{global:appPath}/content/{1}/{2}/{3}.pdf"/>
      </map:match>
    </map:pipeline>

---------------------------------------------
http://xml.apache.org/fop/servlets.html#ie

Notes on Microsoft Internet Explorer
Some versions of Internet Explorer will not automatically show the PDF or
call
the servlet multiple times. These are well-known limitations of Internet
Explorer and are not a problem of the servlet. However, Internet Explorer
can
still be used to download the PDF so that it can be viewed later. Here are
some suggestions in this context:

Use an URL ending in .pdf, like http://myserver/servlet/stuff.pdf. Yes, the
servlet can be configured to handle this. If the URL has to contain
parameters, try to have both the base URL as well as the last parameter end
in
.pdf, if necessary append a dummy parameter, like
http://myserver/servlet/stuff.pdf?par1=a&par2=b&d=.pdf. The effect may
depend
on IEx version.

Give IEx the opportunity to cache. In particular, ensure the server does not
set any headers causing IEx not to cache the content. This may be a real
problem if the document is sent over HTTPS, because most IEx installations
will by default not cache any content retrieved over HTTPS. Setting the
Expires header entry may help in this case:
response.setDateHeader("Expires", System.currentTimeMillis() +
cacheExpiringDuration * 1000);
Consult your server manual and the relevant RFCs for further details on HTTP
headers and caching.

Cache in the server. It may help to include a parameter in the URL which has
a
timestamp as the value min order to decide whether a request is repeated.
IEx
is reported to retrieve a document up to three times, but never more often.





Depending on the versions, IE sends 2 or 3 requests for a single PDF
file. That sucks badly, especially with non-cachable pipelines!

http://www.mail-archive.com/user@struts.apache.org/msg23445.html

Sylvain

--
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director



Mime
View raw message