0
我使用yii
扩展名将html转换为pdf,这是我使用的html代码。html to pdf conversion background image
<table cellpadding="0" cellspacing="0" style="width:100%;">
<tr>
<td>
<table cellpadding="0" cellspacing="0" style="width:100%;">
<tr>
<td style="text-align:center; width:100%; padding:35px 0 15px 0;"><img src="<?php echo Yii::app()->baseUrl;?>/images/digest_logo.png" /></td>
</tr>
<tr>
<td style="text-align:center; color:#2d2d2d;">April 18, 2016</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="padding-top:20px;">
<table cellpadding="0" cellspacing="0" style="width:100%; background:#f3f3f1;">
<tr>
<td style="width:100%; padding:40px 75px 35px;">
<h1 style="margin:0 0 35px 0; font-weight:normal; font-size:24px;">Hi, Patron</h1>
<p style="margin:0 0 4px 0; font-size:17px;">Greetings from Crownit,</p>
<p style="margin:0 0 4px 0; font-size:17px;">Crown it believes ut is very important to. make</p>
<p style="margin:0 0 4px 0; font-size:17px;">Lorem ipsum Lorem ipsumhhhhhhhhh hhhhhn </p>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td style="background-image:url(<?php echo Yii::app()->baseUrl;?>/images/bg-script.png)">
sdf
</td>
</tr>
</table>
我突然卡住的地方,我想用background-image
为我设计的一个地方是这样的
当我看到在PDF我得到这个错误的结果
无法加载图像C:/xampp/htdocs//var/www/html/insight/insight/images/bg-script.png
我不知道为什么这个背景CSS不工作在PDF格式,它在浏览器中工作正常。
任何帮助表示赞赏!
你的扩展使用了什么?如果它的html2pdf,那么你应该可以使用标签及其backimg属性在每个页面上指定背景。 http://wiki.spipu.net/doku.php?id=html2pdf:en:v4:page –
georaldc
我使用标签,我知道我可以使用整页背景图像,但如果你仔细阅读这个问题,我会问为单个标题之间的背景 –