加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – 标题没有进入第一页mpdf

发布时间:2020-12-13 17:43:15 所属栏目:PHP教程 来源:网络整理
导读:Header not coming in first page but comming in all other pages in mpdf. 这是我的PHP代码. $mpdf = new mPDF('utf-8','A4','',18,0); $mpdf-SetDisplayMode('fullpage'); $mpdf-list_indent_first_level = 0; // 1 or 0 - whether to indent the first l

Header not coming in first page but comming in all other pages in mpdf.

这是我的PHP代码.

$mpdf   = new mPDF('utf-8','A4','',18,0);
        $mpdf->SetDisplayMode('fullpage');
        $mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
        $htmlFilePath   = $fileName;
        //$mpdf->SetHTMLHeaderByName('header');
        $mpdf->WriteHTHeader not coming in first page mpdfML(file_get_contents($htmlFilePath));

这是我的HTML代码部分.

<htmlpageheader name="header">
                <td class="" colspan="2">
                    <div id="header">
                        <table  cellpadding="0" cellspacing="0" border="0" align="center">
                            <tr><td height="10"></td></tr>
                            <tr>
                                <td colspan="2">
                                    <table border="0" cellpadding="0" cellspacing="0" align="center" width="200mm">
                                        <tr><td align="center"><img src="{ADMINURL}wc_bo/wc_images/wc_background/pdf_header.jpg" width="739" height="206" alt=""></td></tr>
                                    </table>
                                </td>
                            </tr>
                     </table>
                    </div>
                    <!-- <table align="center"  cellpadding="0" cellspacing="0" border="0"  style="width:180mm;">
                        <tr>
                            <td colspan="2" ><img src="{ADMINURL}wc_bo/wc_images/wc_background/login_logo.jpg" width="242" height="" alt=""></td>
                        </tr>
                    </table> -->
                </td>
            </htmlpageheader>
            <sethtmlpageheader name="header" value="on" />

解决方法

Remove your <sethtmlpageheader name="header" value="on" /> and put this code.

<sethtmlpageheader name="header" page="O" value="on" show-this-page="1" />
<sethtmlpageheader name="header" page="E" value="on" />

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读