我在我的控制器中有以下代码,但是我不能打开它生成的pdf。
$html = "<html><head><meta http-equiv='Content-Type' content='text/html; charset=utf-8'></head><body>trial</body></html>";
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf"); 当在框架之外使用时,它可以工作,但我不知道如何检查pdf是如何以任何方式损坏的。任何帮助都将不胜感激!
编辑:
我使用的是Zend Framework1.10,并遵循本教程
http://www.encapsulated.org/blog/2009/08/27/how-to-let-dompdf-and-zend-framework-play-along/发布于 2010-10-04 21:55:30
找到解决方案:
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();我禁用了生成pdf的操作中的布局和视图脚本。
https://stackoverflow.com/questions/3851005
复制相似问题