public function certificadoPalestranteAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $this->autenticacao(); $sessao = Zend_Auth::getInstance()->getIdentity(); $id_pessoa = $sessao["idPessoa"]; $id_evento = $this->_getParam('id', 0); $model = new Application_Model_Participante(); $rs = $model->listarCertificadosPalestrante($id_pessoa, $id_evento); // palestrante em evento_palestrante if (is_null($rs)) { $rs = $model->listarCertificadosPalestrantesOutros($id_pessoa, $id_evento); } if (is_null($rs)) { $this->_helper->flashMessenger->addMessage(array('danger' => 'Você não apresentou esse trabalho neste Encontro.')); return $this->_helper->redirector->goToRoute(array('controller' => 'participante', 'action' => 'certificados'), 'default', true); } try { $certificado = new Sige_Pdf_Certificado(); // Get PDF document as a string $pdfData = $certificado->palestranteEvento(array('nome' => $rs['nome'], 'id_encontro' => $rs['id_encontro'], 'encontro' => $rs['nome_encontro'], 'tipo_evento' => $rs['nome_tipo_evento'], 'nome_evento' => $rs['nome_evento'], 'carga_horaria' => $rs['carga_horaria'])); $filename = "certificado_palestrante_" . $this->_stringToFilename($rs["nome_encontro"]) . "_" . $this->_stringToFilename($rs["nome_evento"]) . ".pdf"; header("Content-Disposition: inline; filename={$filename}"); header("Content-type: application/x-pdf"); echo $pdfData; } catch (Exception $e) { $this->_helper->flashMessenger->addMessage(array('danger' => _('An unexpected error ocurred.<br/> Details: ') . $e->getMessage())); return $this->_helper->redirector->goToRoute(array('controller' => 'participante', 'action' => 'certificados'), 'default', true); } }