Necroing this old post of mine, just in case anyone comes across this problem again. The main problem is that IE hands just the content of its cache to Adobe Reader (or any other plugin). If the response header explicitly tells the browser to not cache the content, no data is handed over to the plugin. The problem can be solved by calling session_cache_limiter('private') before session_start(). However, it's not immediately clear when session_start() is called in a ZF app. It's probably better to call header('Cache-Control: private') just before echoing.
BTW, this problem also occurs in 'text/xml' documents with 'Content-Disposition: attachment' header. -- Mon On Wed, Nov 19, 2008 at 11:07 PM, Mon Zafra <mon...@gmail.com> wrote: > Hi list, > > This might be off-topic as I couldn't tell if the problem is caused by IE, > PHP, Zend_Pdf or Adobe Reader. > > Using PHP 5.2.4, ZF trunk r12700, IE7, Adobe Reader 9 > > <?php > require_once 'Zend/Pdf.php'; > $pdf = new Zend_Pdf(); > $pdf->pages[] = $pdf->newPage(Zend_Pdf_Page::SIZE_A4); > session_start(); > header('Content-Type: application/pdf'); > echo $pdf->render(); > > This should render a PDF with a single blank page. However, IE7 returns a > general error "Internet Explorer cannot display the webpage". If I comment > the session_start() line, the PDF is rendered fine. My problem is that I > need to get some session variables first before rendering the PDF. Has > anyone come across this problem, and how did you solve it? > > > -- > -- Mon >