MPDF致命错误:找不到接口'Psr \ Log \ LoggerAwareInterface'

时间:2017-10-12 21:13:56

标签: php mpdf

我正在尝试使用MPDF,但在加载时我收到以下错误,有人知道原因吗?https://github.com/mpdf/mpdf

enter image description here

我的代码

 <?php 

  require_once APPPATH.'/third_party/mpdf/src/Mpdf.php';

  $mpdf = new mPDF('c','A4');
  $mpdf->writeHTML('<div>HELLO WORLD</div>'); 
  $mpf->Output('new.pdf','I');

  ?>

1 个答案:

答案 0 :(得分:0)

你使用的是mpdf ver 7吗? 如果是,您可以将代码更改为

require_once APPPATH.'/third_party/mpdf7/vendor/autoload.php';
return new \Mpdf\Mpdf();

参考:https://mpdf.github.io/installation-setup/installation-v7-x.html