我在尝试下载 PDF 时遇到此错误。似乎代码期望 xml 字符串在创建 PDF 之前将某些内容回显到屏幕上。
我是否遗漏了设置中的某些内容?我已按照本网站解释的步骤进行操作 http://bakery.cakephp.org/articles/Casmo/2010/06/26/creating-pdf-files-with-html2ps-html2pdf .
最佳答案
嗨,潘卡,
Cakephp2.3.x 文件夹名称从“vendor”更改为“Vendor”。这就是你收到错误的原因..
Cakephp 1.3.X:在我们使用的 PdfComponent 中
//包含类文件并创建 Html2ps 实例
App::import('vendor', 'Html2PsConfig', array('file' => 'html2ps'.DS.'config.inc.php'));
App::import('vendor', 'Html2Ps', array('file' => 'html2ps'.DS.'pipeline.factory.class.php'));
parse_config_file(APP .'vendors'. DS .'html2ps'. DS .'html2ps.config');
Cakephp 2.3.X:在 PdfComponent 中,您必须更改与下面相同的代码。
//包含类文件并创建 Html2ps 实例
App::import('Vendor', 'Html2PsConfig', array('file' => 'html2ps'.DS.'config.inc.php'));
App::import('Vendor', 'Html2Ps', array('file' => 'html2ps'.DS.'pipeline.factory.class.php'));
parse_config_file(APP .'Vendor'. DS .'html2ps'. DS .'html2ps.config');
试试这个可能对你有帮助.. :-)
关于cakephp - "Can not buid tree with empty xml"在 cakephp 2.3.8 中使用 html2ps 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18266851/