带有 codeigniter 的 dompdf

发布于 2024-07-26 21:49:17 字数 858 浏览 16 评论 0原文

我遵循了本教程:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

抚你发端 2024-08-02 21:49:17

自动加载的自定义加载器与 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.

烦人精 2024-08-02 21:49:17

该文件将 $_GET['input_file'] 作为要转换为 pdf 的文件的名称

http://localhost/dompdf/dompdf.php?input_file=[nameofyourfile]

this file take $_GET['input_file'] as the name of the file that should be converted to pdf

http://localhost/dompdf/dompdf.php?input_file=[nameofyourfile]
寂寞清仓 2024-08-02 21:49:17

如果您已将 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文