dompdf: loading html files to render, doesn't work

前端 未结 1 403
广开言路
广开言路 2021-01-13 08:34

dompdf is not able to generate a pdf from a page of my website. However, I\'ve saved the page and uploaded it as simple static html file, and it worked!

So, I don\'t

1条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-13 09:32

    DOMPDF is trying all kinds of stuff/eval's when running local, you're better of trying:

    1) the (granted, long way trip) of requesting the HTML by http:

    $dompdf->load_html_file('http://yourdomain.ext/'.$file);
    

    2) Don't let DOMPDF eval but use output buffering itself, and let DOMPDF load the resulting string of HTML.

    load_html(ob_get_clean());
        $dompdf->render();
    ?>
    

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