Dompdf remote image is not displaying in pdf

后端 未结 17 2240
臣服心动
臣服心动 2020-12-09 17:28

On my server pdf generated via dompdf was not displaying images. Because they are remote url images.(local images are working fine) then I come to know that it needs some se

17条回答
  •  死守一世寂寞
    2020-12-09 17:59

    I am giving you an example with function

      $html = $this->output->get_output();
            $this->load->library('pdf');
            $this->dompdf->loadHtml($html);
            $this->dompdf->set_option('isRemoteEnabled', true);
            $this->dompdf->setPaper('A4', 'portrait');
            $this->dompdf->render();
            $this->dompdf->stream("studentidcard.pdf", array("Attachment"=>0));
    

    Set isremoteenabled true to show remote images

提交回复
热议问题