【发布时间】:2021-03-12 11:21:17
【问题描述】:
使用 Dompdf 生成 pdf 文件。该文件已成功创建并下载,但我正在运行它的页面会生成一个致命错误 - 找不到类“Dompdf\Dompdf”。
我已经下载了最新的包并上传到服务器。
我正在使用此处的快速启动代码 - https://github.com/dompdf/dompdf#easy-installation
require_once 'path/to/the/folder/here/dompdf/autoload.inc.php';
// reference the Dompdf namespace
use Dompdf\Dompdf;
// instantiate and use the dompdf class
$dompdf = new Dompdf();
$dompdf->loadHtml('hello world');
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'landscape');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream();
我已经阅读了我能找到的所有相关支持帖子,但似乎没有任何效果
【问题讨论】:
标签: dompdf