 <p>In cake2 you can use a cleaner approach - with or without the new response object: <a href="http://www.dereuromark.de/2011/11/21/serving-views-as-files-in-cake2/" rel="nofollow">http://www.dereuromark.de/2011/11/21/serving-views-as-files-in-cake2/</a></p> <p>The headers will be set by cake itself from the controller. It's not good coding (anymore) to set them in the layout (I used to do that, as well^^).</p> <p>These days the <a href="https://github.com/ceeram/CakePdf" rel="nofollow">CakePdf plugin</a> has matured quite a bit into a very useful tool for PDF generation. I recommend using that in Cake2.x.</p> <p>See <a href="http://www.dereuromark.de/2014/04/08/generating-pdfs-with-cakephp" rel="nofollow">http://www.dereuromark.de/2014/04/08/generating-pdfs-with-cakephp</a></p>