dompdf not rendering images from the server but is rendering from external source

Deadly 提交于 2019-12-06 05:23:25

Your image link must use the relative path from your web folder. Example, if your web folder is in /var/www/html/myweb and your image in your CI folder is in assets/images (in the same level as application folder), you just write the relative path : assets/images/imgname.jpg.

Aboudramane ZARE

I had the exact same problem, no images were displaying for me - background images and inline ones. I had to set DOMPDF_ENABLE_REMOTE to true in your config dompdf_config.inc.php

Just note the security risk if you have this enabled along with DOMPDF_ENABLE_PHP.

Add following lines

$dompdf = new DOMPDF();
$dompdf->set('isRemoteEnabled', true);
$dompdf->load_html($html);

if this is not working then change method from set to set_option

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