php - 如何使用 TCPDF 在 pdf 页面中显示图像?
问题描述
请找到以下代码。当我 print_r() 输出时,图像显示在网页中。但图像未显示在 PDF 页面中。谁能告诉我我的代码有什么问题?
$link = base_url();
foreach($defect_photos as $defect_photo){
$html1 .= "<td><img src='$link/uploads/defects/$defect_photo' border='0' height='500' width='500' align='right'></td>";
}
$html1 .= '</tr></table>';
//print_r($html1);
//exit;
$pdf->writeHTML($html1, true, false, true, false, '');
提前致谢
解决方案
使用这行代码,您可以在 tcpdf 上添加图像。或详细信息,您可以访问https://tcpdf.org/examples/example_009/
$pdf->Image('images/image_demo.jpg', '', '', 40, 40, '', '', 'T', false, 300, '', false, false, 1, false, false , 错误的);
推荐阅读
- powershell - 在 Active Directory 中更新多个用户 - 国家和经理属性问题
- c++ - 如何在子进程结束后立即捕获它?
- c# - Microsoft Visual Studio 社区 2019 版本 16.8.2。创建新的移动应用程序(Xamarin Forms)项目时出现问题
- python-3.x - 为什么我的第一条机器人消息(通过 REST API)显示在我的第一条线程消息之前?
- php - 带/不带 TRIM 的查询
- runtime-error - “/”应用程序中的服务器错误。运行时错误
- angular - 离子用户界面未显示
- python - 字符串格式未按预期工作
- java - 计算时钟滴答以评估性能
- c++ - Visual Studio 2019 C++ 调试:“符号文件中没有可用的类型信息”