douleng3463 2012-12-01 10:42
浏览 54
已采纳

标题没有进入第一页mpdf

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

here is my php code.

$mpdf   = new mPDF('utf-8','A4','','' , 0 , 0 , 0 , 18 , 0 , 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));

here is my html code part.

<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" />
  • 写回答

2条回答 默认 最新

  • douyimiao1993 2012-12-03 06:42
    关注
     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" />
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?