【问题标题】:How to display pdf or print pdf [closed]如何显示 pdf 或打印 pdf [关闭]
【发布时间】:2018-01-10 10:50:51
【问题描述】:

如何使用php或html显示pdf和打印?我想使用来自 phpmyadmin 的数据来制作 pdf 格式的数据

【问题讨论】:

    标签: php pdf phpmyadmin xampp


    【解决方案1】:

    我会说使用 dompdf 它获取 html 文件并以 pdf 格式打印,您可以选择用户查看或下载它,您可以将 php 变量放在 html 文件中。 github链接 https://github.com/dompdf/dompdf

    文档中的示例

    // 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();
    

    【讨论】:

      猜你喜欢
      • 2010-09-30
      • 1970-01-01
      • 2020-01-06
      • 1970-01-01
      • 2011-07-30
      • 1970-01-01
      • 1970-01-01
      • 2012-12-06
      • 1970-01-01
      相关资源
      最近更新 更多