dompdf and img tag, image wont show(dompdf 和 img 标签,图像不会显示)
问题描述
这是调用 $dompdf->render() 和 $dompdf->output() 之前的 HTML:
Here is the HTML just before $dompdf->render() and $dompdf->output() are called:
<img src="http://www.example.com/images/Logo.png" />
所有其他发票在浏览器中查看、打印或以 HTML 格式通过电子邮件发送时都能正常显示图像.当我在应用程序中单击生成 PDF"时,它会以 PDF 格式呈现发票,但缺少徽标.我已经添加了一个调试行,通过电子邮件将它发送到 render() 的原始 HTML 发送给我,我觉得它很好.
All other invoices display the image fine when viewing in the browser, or printing it, or emailing it as HTML. When I click 'Generate PDF' inside of our application, it renders the invoice in PDF, except the logo is missing. I have put a debugging line in to email me the raw HTML it sends to the render(), and it looks fine to me.
有谁知道为什么 dompdf 不显示此图像?
Does anyone have any idea why dompdf won't display this image?
推荐答案
一个想法:如果您为图像提供完整的 URI,它被视为外部图像,因此定义的 costant DOMPDF_ENABLE_REMOTE 必须设置为是真的.
An idea: if you are providing full URI to the image it is treated as external, so defined costant DOMPDF_ENABLE_REMOTE must be set to true.
这篇关于dompdf 和 img 标签,图像不会显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:dompdf 和 img 标签,图像不会显示
基础教程推荐
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
