【问题标题】:dompdf failed to load document in cakephpdompdf 无法在 cakephp 中加载文档
【发布时间】: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有关吗

【问题讨论】:

标签: cakephp dompdf


【解决方案1】:

这个插件非常适合在 cakephp 上生成 pdf

https://github.com/DaoAndCo/cakephp-dompdf

【讨论】:

    猜你喜欢
    • 2018-07-19
    • 2018-12-19
    • 1970-01-01
    • 2014-06-05
    • 1970-01-01
    • 2020-07-12
    • 2018-01-10
    • 2016-08-15
    • 2018-09-16
    相关资源
    最近更新 更多