DomPDF: Image not readable or empty

后端 未结 9 1235
梦如初夏
梦如初夏 2020-12-15 16:41

For some reason, DomPDF won\'t render an image included in the html that is being parsed:

\"PDF

9条回答
  •  無奈伤痛
    2020-12-15 17:36

    As there was another answer that suggests enabling the remote option in module.config.php and I can't yet add comments, I thought it would be best to answer that this file does not exist in newer versions of DomPDF.

    If you need to include remotely stored images in a newer version you have to pass it as an option to the constructor:

    $dompdf = new Dompdf(array('enable_remote' => true));
    

    This fixed the issue I had.

提交回复
热议问题