PHPWord to PDF not able to load library

后端 未结 3 1412
我寻月下人不归
我寻月下人不归 2021-01-20 15:50

I have been trying all day to get this to work. Right now I am able to save the document as .docx file but I wanted to be able to save the document as PDF I have tried with

3条回答
  •  攒了一身酷
    2021-01-20 16:35

    When I print the error to log, I realize it is trying to load the dompdf_config.inc.php from an invalid location. See below.

    C:\wamp\www\cccake\app\Vendor\dompdf\dompdf.php/dompdf_config.inc.php\n

    Rather than altering the class files of PHPExcel/ PHPWord, it's wise to change the configuration in your view. Ignoring the $rendererLibrary completely in the $rendererLibraryPath fixed my issue. I think the PHPExcel/PHPExcel know how to pick dompdf.php file (tcpdf.php) in your case. Try below code let us know if it doesn't work.

    $rendererLibrary = 'tcpdf.php'; $rendererLibraryPath = dirname(FILE) .'/plugins/tcpdf';

提交回复
热议问题