Zend_Pdf and damaged PDF files in acrobat
Category: Development, Zend Framework, php

Playing with Zend_Pdf all my files open perfectly in preview.app. But switching to Adobe Acrobat I got this error:

Adobe Reader could not open 'file.pdf' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded).

I had the noViewRenderer set in my action but that wasn’t enough. Place the snippet below in your controller action:

$this->_helper->layout->disableLayout();
self::getFrontController()->setParam("noViewRenderer", true);

Tags: ,

Leave a Comment