【问题标题】:created Pdf using Html2pdf i don't know how to save and retrieve pdf [closed]使用 Html2pdf 创建 Pdf 我不知道如何保存和检索 pdf [关闭]
【发布时间】:2012-02-25 10:03:56
【问题描述】:

我是使用 Html2pdf 创建的 Pdf,我不知道如何保存和检索 pdf,我是 php 新手,请帮助我 提前致谢

【问题讨论】:

  • 他们的文档解释了很多。你真正想要的是什么。你被困在某个地方了吗?如果是,请显示您的代码
  • 重复PDF created with FPDF and how to save and retrieve the pdf请不要转发问题;请阅读有关原始问题的建议,您已经得到了答案。
  • 对不起,现在我将 pdf 创建 fpdf 更改为 html2pdf ,因为制作 pdf 很简单。这就是我第二次询问的原因

标签: php mysql html2pdf


【解决方案1】:

正如您在 html2pdf 中的示例中看到的那样

<?php
    $content = "
<page>
    <h1>Exemple d'utilisation</h1>
    <br>
    Ceci est un <b>exemple d'utilisation</b>
    de <a href='http://html2pdf.fr/'>HTML2PDF</a>.<br>
</page>";

    require_once(dirname(__FILE__).'/html2pdf/html2pdf.class.php');
    $html2pdf = new HTML2PDF('P','A4','fr');
    $html2pdf->WriteHTML($content); // in $content you put your content to have in pdf
    $html2pdf->Output('exemple.pdf');
?>

编辑: 这样你就可以保存在服务器上。

  $html2pdf->Output('directory/filename_xxxx.pdf', 'F');
  Add the name to mysqldb.

当你想要 pdf 内容时,你将从 db 中获取名称并制作你需要的内容:)

【讨论】:

  • 我完成了这个我想保存并检索到 mysql 数据库中
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-03-27
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多