dompdf和img标签,图像不显示 [英] dompdf and img tag, image wont show

查看:736
本文介绍了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 必须设置为true。

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标签,图像不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆