php - DOMPDF:图像不可读或为空。 (与 barryvdh/laravel-dompdf)

标签 php html image laravel dompdf

我将 DOMPDF 与 Laravel-dompdf 一起使用,经过数小时的研究后,我找不到能够渲染我的图像的解决方案。 我已经提到了这些问题:

DomPDF: Image not readable or empty

dompdf image not real image not readable or empty

在两个包配置文件中,我都有 def("DOMPDF_ENABLE_REMOTE", true);def("DOMPDF_ENABLE_AUTOLOAD", true);。当然我已经检查了路径,它们都是正确的。我也试过this solution ,这对我不起作用。

谁能提供不同的解决方案?

最佳答案

我通过使用公共(public)路径解决了这个问题:

<img src="{{ public_path('image.jpg') }}" />

关于php - DOMPDF:图像不可读或为空。 (与 barryvdh/laravel-dompdf),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26618246/

相关文章:

html - sencha touch::在列表前添加一些文本

html - 如何让导航栏固定在底部而不是顶部

javascript:刷新时选择的随机图像

html - CSS 边框超出图像宽度

php - 我什么时候编写自己的异常类?

php - 选择 TimeDate = now() =< 2 年后的记录

javascript - JQuery 处理运行时生成元素时的事件

java - 为什么 90/270 度的仿射旋转不能保留正确的尺寸,而是将宽度和高度重新调整为相同的像素大小?

php - PHP 中的 HTML 净化

php - 为什么我的代码容易受到 xss 攻击?