public function getpdfAction() {
//Disable rendering of view script and layout
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
// We'll be outputting a PDF
header('Content-type: application/pdf');
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');
// The PDF source is in original.pdf
readfile('some_pdf_file.pdf');
}
Wednesday, October 5, 2011
Zend Framework: Returning pdf file from an action controller
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment