【发布时间】:2016-04-24 13:09:54
【问题描述】:
这是我在 book_pdf.ctp 中的代码
<?php
require_once(ROOT . DS . 'Vendor' . DS . 'dompdf/dompdf' . DS . 'autoload.inc.php');
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();
?>
每当我下载文档时,它说加载失败。
这和cakephp有关吗
【问题讨论】:
-
如果你用这个插件会更好github.com/friendsofcake/cakepdf