使用带有徽标的PHP下载PDF始终位于每页的顶部

时间:2017-10-07 12:38:07

标签: php pdf

我有这个代码显示在页面上,但是我也想给用户提供下载PDF的选项,但是在每个PDF页面的顶部我想要一个徽标图片,我该怎么做?有数据表的方法吗?或者只是简单的代码?

<table>
<?php

foreach($sheets as $s):
echo "<tr>";
echo "<td>";
$name= explode(' ',$s['customer_name'])
?>
<div style="text-align: center">
<img alt="" src="/adminpanel2/public/logo.png">
</div> 
<h2 style="text-align: center">Hi <?php echo $name[0] ?>!</h2>
    <div align="center">
   <br> Here is your delivery for: <br>
   <?php echo date('l, F dS', strtotime($s['delivery_week']));?>
   <br>
   ORDER NO. <?php echo $s['order_id'] ?>&nbsp; | &nbsp;  CUSTOMER NO.<?php echo $s['client_id'] ?>
   <hr style="height: 5px;border-top:1px solid #000 !important;margin-bottom:0px">
   <hr style="height: 5px;border-top:1px solid #000 !important;margin-top: 5px !important;">
   </div>
   <?php foreach($s['meals'] as $m):?>
   <h3><?php echo $m['display_name'];?> </h3>
   <?php echo $m['count']?> &nbsp; SERVING SHIPPED<br><br>
   COMPONENTS
   <hr align = "left" style="width: 115px; border-top:1px solid #000 !important;margin-top: 5px !important;margin-bottom:0px">
   <br>
   <?php foreach($m['components'] as $c):?>
   <?php echo $c?><br>
   <?php endforeach;?>
   <hr align="left" style="width: 400px; border-top:1px solid #000 !important;margin-top: 5px !important;margin-bottom:0px" >
   <?php endforeach;?>
   <hr align="left" style="width: 600px; border-top:1px solid #000 !important;margin-top: 5px !important;margin-bottom:0px" >
   <div align="center"><h3> Thank you,<?php echo $name[0] ?>!</h3> 

    <hr style="width: 600px; border-top:1px solid #000 !important;margin-top: 5px !important;margin-bottom:0px" >
   </div>
   <br>
   <br>
    <br>
   <br>
    <br>
   </td>
   </tr>
<?php endforeach; ?>

</table>

这是我的代码(上图)我使用的是php燃料

0 个答案:

没有答案