dompdf image not real image not readable or empty

拜拜、爱过 提交于 2019-12-02 09:08:31

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

Are you loading this code directly into dompdf:

$html = '<img src="<?php echo $_POST["sig"]; ?>" />';
$dompdf->load_html($html);

or

$dompdf->load_html_file(foo.php);

Or are you loading the processed PHP document:

$html = '<img src="' . $_POST["sig"]; . '" />';
$dompdf->load_html($html);

or

$dompdf->load_html_file('http://example.com/foo.php');

If the PHP content is not being processed prior to loading it into dompdf then it will not be processed at all. By default (as of 0.6.0) does not process any PHP code in the HTML document. You would have to set DOMPDF_ENABLE_PHP to true.

Dartagnan

I had this same problem.

Correct it by setting the file dompdf_config.inc.php:

def ('DEBUGKEEPTEMP', true);

Hope this helps.

squall3d

Setting DEBUGKEEPTEMP to true worked, but if you are paranoid, and wary of the effect of turning this on, you can also add self::$_cache=array(); to the end of class Image_Cache's clear();

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