美文网首页
thinkphp 导出生成PDF文件

thinkphp 导出生成PDF文件

作者: 破晓丨 | 来源:发表于2019-03-22 14:10 被阅读0次
    include_once "/vendor/mpdf/mpdf.php"; //引入该类库
    // 设置中文编码
    $mpdf=new \mPDF('zh-cn','A4', 0, '宋体', 0, 0);
    $html="<link href='./css.css' rel='stylesheet' type='text/css'>";
    $html.='<h1 class="hq"><a name="top"></a>666</h1>';
    $html.='<img src="mofang.png" width="100px">';
    $html.='<img src="mofang.png" width="500px">';
    $mpdf->WriteHTML($html);
    $mpdf->Output();
    exit;
    

    mpdf 库:
    链接: https://pan.baidu.com/s/1cFJC7QGTnkM_n490nLoklQ
    提取码: 7h9y
    php 生成pdf文件可以设置 css样式,图片的引入等。

    相关文章

      网友评论

          本文标题:thinkphp 导出生成PDF文件

          本文链接:https://www.haomeiwen.com/subject/koglvqtx.html