PHPWord to PDF not able to load library

半腔热情 提交于 2019-12-02 01:45:01

Knowing al that, I'm guessing the answer is changing:

$includeFile = Settings::getPdfRendererPath() . '/' . $this->includeFile;

to

$includeFile = Settings::getPdfRendererPath();

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';

Make sure to send DOMPDF Path in:

$domPdfPath = "..vendor/dompdf/dompdf/";
Settings::setPdfRendererName(Settings::PDF_RENDERER_DOMPDF);
Settings::setPdfRendererPath($domPdfPath); //<---

Then in AbstractRerender construct if you echo $this->Include file you should see 'dompdf_config.inc.php'

If you don't have dompdf_config.inc.php file, try to use dompdf 0.6.2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!