Example #1
0
 /**
  * @return \Zend\Stdlib\ResponseInterface
  */
 public function renderAction()
 {
     $affiliationService = $this->getAffiliationService()->setAffiliationId($this->params('affiliation-id'));
     //Create an empty Doa object
     $programDoa = new Doa();
     $programDoa->setContact($this->zfcUserAuthentication()->getIdentity());
     $programDoa->setAffiliation($affiliationService->getAffiliation());
     $renderProjectDoa = $this->renderDoa()->renderProjectDoa($programDoa);
     $response = $this->getResponse();
     $response->getHeaders()->addHeaderLine('Expires: ' . gmdate('D, d M Y H:i:s \\G\\M\\T', time() + 36000))->addHeaderLine("Cache-Control: max-age=36000, must-revalidate")->addHeaderLine("Pragma: public")->addHeaderLine('Content-Disposition', 'attachment; filename="' . $programDoa->parseFileName() . '.pdf"')->addHeaderLine('Content-Type: application/pdf')->addHeaderLine('Content-Length', strlen($renderProjectDoa->getPDFData()));
     $response->setContent($renderProjectDoa->getPDFData());
     return $response;
 }