I'm afraid I don't have very encouraging news on this topic.  I work at a 
company where we've been dynamically generating PDF files in response to web 
requests for a couple of years.  And I can say with confidence that IE cannot 
support this reliably, period.  We've tried:

- setting the content length in the response
- sending a server-side redirect to the generated file
- using JavaScript on page loading for a client-side redirect
- putting a ".pdf" extension into the URL to make IE think it's a static file
- many, many more, and in many combinations

There are many notes about this topic in both the Microsoft and Adobe 
knowledge base archives, but the fixes only apply to certain versions of IE.  
And that's the fundamental problem; the way IE breaks when trying to handle 
this changes *literally* every service pack, every version.  So it'll work 
fine on your machine running IE6 sp1, but will break on your customer's IE6 
sp2.  (Note you can't even tell them to upgrade; it tends to get worse in 
newer versions rather than improving.)  I'm pretty sure all the fixes in the 
knowledge bases and that people post in this thread only work for the handful 
of versions they were able to test; it *will* still break for other IE users.

We had found a set of hacks that worked consistently as long as you generated 
the PDF from a link instead of a submit; a couple of IE service packs back, 
it stopped working.  The truly aggravating thing is that at least 75% of the 
ways we tried work consistently in all versions of Netscape 4.x, Mozilla, 
Konqueror, and Opera available for Windows and Linux (and presumably MacOS).
I strongly suspect Microsoft is doing this deliberately, as part of a 
strategy to sabotage cross-platform document formats or something...it really 
feels like they go out of their way to break it every time somebody finds a 
way to make it work, and it works flawlessly in every other browser.

Our final solution: read the user agent from the request, and if it's IE 
serve back a small HTML page containing a direct link to the generated PDF 
file.  Users of other browsers still get the PDF back directly, and with one 
extra click IE users can get the generated content (until Microsoft breaks 
the Acrobat plugin completely).

Jeremy


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to