Consultez la FAQ sur le ZF avant de poster une question
Vous n'êtes pas identifié.
Bonjour,
J'espère recevoir une aide dans ce forum
J'essaye d'utiliser "DomPDF", le fichier PDF est bien généré mais impossible de l'ouvrir. (Adobe n'a pas réussi à ouvrir...)
Voici l'erreur qui est contenue dans le PDF
Fatal error: Uncaught exception 'Zend_Controller_Response_Exception' with message 'Cannot send headers; headers already sent in , line 0' in /var/www/html/zendTest/library/Zend/Controller/Response/Abstract.php on line 321 Zend_Controller_Response_Exception: Cannot send headers; headers already sent in , line 0 in /var/www/html/zendTest/library/Zend/Controller/Response/Abstract.php on line 321 Call Stack: 0.0004 331324 1. {main}() /var/www/html/zendTest/public/index.php:0 0.0559 5087628 2. Zend_Application->run() /var/www/html/zendTest/public/index.php:26 0.0559 5087628 3. Zend_Application_Bootstrap_Bootstrap->run() /var/www/html/zendTest/library/Zend/Application.php:366 0.0560 5087684 4. Zend_Controller_Front->dispatch() /var/www/html/zendTest/library/Zend/Application/Bootstrap/Bootstrap.php:97 0.1706 11136688 5. Zend_Controller_Response_Abstract->sendResponse() /var/www/html/zendTest/library/Zend/Controller/Front.php:992 0.1706 11136688 6. Zend_Controller_Response_Abstract->sendHeaders() /var/www/html/zendTest/library/Zend/Controller/Response/Abstract.php:766 0.1706 11136716 7. Zend_Controller_Response_Abstract->canSendHeaders() /var/www/html/zendTest/library/Zend/Controller/Response/Abstract.php:339
Voici l'Action de mon contrôleur :
public function planningpdfAction() { $this->_helper->layout->disableLayout(); require_once('../library/dompdf/dompdf_config.inc.php'); spl_autoload_register('DOMPDF_autoload'); $html = "<html><body>Test</body></html>"; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("sample.pdf"); }
Quelqu'un a une idée ?
Hors ligne
Bonjour,
Je pense qu'il te manque
$this->_helper->viewRenderer->setNoRender();
Par contre je ne suis pas certain que ça soit la cause de l'erreur.
A+, Philippe
Hors ligne
Merci, cela m'affiche bien un "Test". Est-ce que tu sais comment faire pour qu'il m'affiche le html de la vue ?
edit : avec
$html = $this->view->render('planning/index.phtml');
Dernière modification par kai23 (20-01-2011 10:47:47)
Hors ligne
En revanche, existe-t-il un moyen de choisir où commence le HTML ?
Hors ligne