DOMPDF with CODEIGNITER

后端 未结 6 641
刺人心
刺人心 2021-01-07 12:16

I am trying to get dompdf working with codeigniter, I download the file from here https://github.com/dompdf/dompdf/releases the version was 0.7.0 and then I put inside my co

6条回答
  •  别那么骄傲
    2021-01-07 12:41

    require_once(dirname(__FILE__) . '/dompdf/autoload.inc.php');
    use Dompdf\Dompdf;
    
    class Pdf
    {
     public function create($html,$filename)
     {
       $dompdf = new Dompdf();
       $dompdf->loadHtml($html);
       $dompdf->render();
       $dompdf->stream($filename.'.pdf');
     }
    

    Try this library https://github.com/hanzzame/ci3-pdf-generator-library

    This library using

    • Dompdf 0.8.0
    • Codeigniter 3.x.x
    • Support SSL Connection for image

提交回复
热议问题