带有 codeigniter 的 dompdf
我遵循了本教程:
https://github.com/EllisLab/CodeIgniter /wiki/PDF- Generation-using-dompdf
但是,我似乎无法设置正确的路径。 在 dompdf 的配置文件(config_dompdf.inc.php
)上,我执行了以下操作:
define("DOMPDF_DIR", realpath(dirname('./system/plugins/dompdf/')));
我收到此错误:
Message: require_once(/var/www/myApp/system/plugins/include/functions.inc.php) [function.require-once]: failed to open stream: No such file or directory
Filename: dompdf/dompdf_config.inc.php
Line Number: 233
根据教程,我将 dompdf 目录放置在 system/plugins
下>。 但是你可以看到上面第233行,由于路径不正确而出现错误。 如何修复路径?
(define("DOMPDF_DIR", realpath(dirname('./system/plugins/dompdf/')));)
谢谢!
I followed this tutorial:
https://github.com/EllisLab/CodeIgniter/wiki/PDF-generation-using-dompdf
However, I can't seem to set the path right. On the config file of dompdf (config_dompdf.inc.php
) I did the following:
define("DOMPDF_DIR", realpath(dirname('./system/plugins/dompdf/')));
I get this error:
Message: require_once(/var/www/myApp/system/plugins/include/functions.inc.php) [function.require-once]: failed to open stream: No such file or directory
Filename: dompdf/dompdf_config.inc.php
Line Number: 233
As per the tutorial, I placed the dompdf directory under system/plugins
. But you can see above that on line 233, there is an error because of an incorrect path. How do I fix the path?
(define("DOMPDF_DIR", realpath(dirname('./system/plugins/dompdf/')));)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
自动加载的自定义加载器与 DOMPDF 冲突,这就是它不起作用的原因。 由于应用程序的所有控制器都使用自定义加载程序,因此已切换到 TCPDF。
A custom loader that is on autoload is conflicting with DOMPDF, that's the reason it doesn't work. Switched to TCPDF since the custom loader is used by all controllers of the app.
该文件将
$_GET['input_file']
作为要转换为 pdf 的文件的名称this file take
$_GET['input_file']
as the name of the file that should be converted to pdf如果您已将 dompdf_config.inc.php 从 dompdf 目录中的常用位置移动,则只需更改
DOMPDF_DIR
的值。 否则,dompdf 已设置为使用正确的路径填充该常量。 根据您提供的信息,我认为您不应该修改默认值。You only need to change the value of
DOMPDF_DIR
if you have moved dompdf_config.inc.php from its usual location in the dompdf directory. Otherwise, dompdf is already set up to populate that constant with the correct path. Based on the information you have provided I do not believe you should have modified the default value.