【发布时间】:2011-11-13 16:45:54
【问题描述】:
我使用 tcpdf 将 HMTL 转换为 PDF 的代码。
$html = '<pre>
<br/>
<h3><a href="/node/02" title="View Original Document">aa</a></h3>
<br/>
<img width="628" height="674" class="imagecache imagecache-assetimage" title="" alt="" src="http://test/a_image/AssignPage.jpg" /> </pre>';
$htm = '<div style="font-size:40px !important;">'.$html.'</div>';
$pdf->writeHTML($htm, TRUE, TRUE, TRUE, FALSE, '');
上面的代码打印出以下错误信息:
TCPDF ERROR: [Image] Unable to get image: /path-of-the-image
如果 HTML 不包含图像,它可以正常工作。
如何解决这个问题?
任何帮助将不胜感激......
提前谢谢..
【问题讨论】:
-
在你的地址栏中试试这个 "test/a_image/AssignPage.jpg"" 是否有效?
-
s。我检查了它..图像在那里!
-
尝试打印您的 html...可能会对您有所帮助...