PHP PDF-Generation - IE7 / Acrobat8: "Website Not Displaying"

I am having trouble displaying PDFs in IE7 (which were generated by R & OS 'ezpdf).

IE7 with Acrobat Reader 8.1.2. "Unable to display page"

Other browsers (like FF3 / Acrobat 8.1.2 or IE6 / Acrobat 7) have no problem with the file.

Servers return the following headers:

Date: Thu, Jan 08 2009 10:52:40 GMT
Server: Apache / 2.2.8 (Win32) mod_ssl / 2.2.8 OpenSSL / 0.9.8g PHP / 5.2.5 DAV / 2
X-Powered-By: PHP / 5.2.5
Expires: Thu, November 19, 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check = 0, pre-check = 0
Pragma: no-cache
Content-length: 4750
Keep- Alive: timeout = 5, max = 100
Connection: Keep-Alive
Content-Type: application / pdf

Does anyone know how to fix this problem?

+1


source to share


2 answers


Cache-Control: no-store, no-cache, must-revalidate, post-check = 0, pre-check = 0 Pragma: no-cache

... so IE won't store the file in the Temporary Internet Files folder. However, the mechanism used to directly "open" a file from a browser in IE often requires opening it from inside temporary Internet files. Opening a file directly from a browser is generally unreliable, especially in IE; Save As works better.



Consider replacing the cache headers with an alternative method, such as adding the '? randomstring '. Also consider adding Content-Disposition: attachment; filename = ... which will stop the plugin and fail to display the file in the browser UI.

+2


source


I think I solved the problem.

The problem is not server side but client side. The generated PDF is displayed in a popup (javascript: window.open) and IE7 throttles it.



When I open the html file in a popup that redirects to PDF, it works.

0


source







All Articles