/** * Generate PDF for selected product * * @var int $id Selected product */ public function pdfAction() { $this->getResponse()->setHeader('Content-Type', 'application/pdf'); $productsModel = new Model_DbTable_Products(); // get product $id = $this->getRequest()->getParam("id"); $product = $productsModel->find($id)->current(); // generate pdf $pdfBook = new Model_Static_PdfBook('A5'); $pdfBook->byProduct($product); $this->view->content = $pdfBook->finishBook(); $this->_helper->layout()->disableLayout(); }