dompdf and img tag, image wont show

匿名 (未验证) 提交于 2019-12-03 01:27:01

问题:

Here is the HTML just before $dompdf->render() and $dompdf->output() are called:

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.

Does anyone have any idea why dompdf won't display this image?

回答1:

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.



回答2:

Looks like you have to pass the server path and not the server url in the src param

http://www.flashnutz.com/2009/08/images-not-working-in-dompdf/



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!