尝试使用codeigniter
在tcpdf中显示图片时遇到问题这是我的pdf视图:
$base_url=base_url();
// NON-BREAKING ROWS (nobr="true")
$tbleauproduct = <<<EOD
<br /><br /><br />
<table border="1" align="center">
<tr>
<th>picture</th>
<th>Product name</th>
<th>Price</th>
<th>Quantity</th>
</tr>
<tr>
<td><img src="$base_url/assets/$picture" /></td>
<td>$name</td>
<td>$price</td>
<td>$qty</td>
</tr>
</table>
EOD;
$pdf->writeHTML($tbleauproduct, true, false, true, false, '');
这就是结果:
TCPDF ERROR: [Image] Unable to get the size of the image: http://localhost:8888/open_bay//assets/130501153059-htc-one-1024x576.jpeg
答案 0 :(得分:0)
$file_path = base_url().'assets/130501153059-htc-one-1024x576.jpeg';
$size = filesize($file_path);