dompdf image not real image not readable or empty

后端 未结 4 1923
春和景丽
春和景丽 2021-01-29 04:20

i\'m having problems with dompdf, the images i insert wont read when converted to pdf file

when i load it to dompdf using

php method



        
相关标签:
4条回答
  • 2021-01-29 04:48

    I had this same problem.

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

    def ('DEBUGKEEPTEMP', true);

    Hope this helps.

    0 讨论(0)
  • 2021-01-29 04:53

    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();

    0 讨论(0)
  • 2021-01-29 05:01

    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.

    0 讨论(0)
  • 2021-01-29 05:09

    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

    0 讨论(0)
提交回复
热议问题