created Pdf using Html2pdf i don't know how to

2019-07-11 04:05发布

i am created Pdf using Html2pdf ,i don't know how to save and retrieve pdf, i am new in php please help me thanks in advance

1条回答
放荡不羁爱自由
2楼-- · 2019-07-11 04:40

as you can see in example in 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');
?>

EDIT: with this you save on server.

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

When you want pdf content,you will get name from db and make what you need :)

查看更多
登录 后发表回答