If you know smth about this theme please leave a comment. I am trying to get pdf file from docx using phpoffice/word. But i cant make it real because for whole day testing i get only this error:
PHP Fatal error: Uncaught exception 'PhpOffice\PhpWord\Exception\Exception' with message 'PDF rendering library or library path has not been defined.
Please don't tell me to look this question in www, i tried - nothing helpful. My code:
require './vendor/autoload.php';
require './vendor/phpoffice/phpword/bootstrap.php';
$filename = 'example';
echo PHPWORD_BASE_DIR . '/TCPDF-master';
$wordPdf = \PhpOffice\PhpWord\IOFactory::load("./file_to_fill/ДКП квартира физики.docx");
$rendererName = \PhpOffice\PhpWord\Settings::PDF_RENDERER_TCPDF;
$rendererLibrary = 'TCPDF';
$rendererLibraryPath = dirname(__FILE__).'/'. $rendererLibrary;
\PhpOffice\PhpWord\Settings::setPdfRendererPath($rendererLibraryPath);
\PhpOffice\PhpWord\Settings::setPdfRendererName('TCPDF');
$pdfWriter = \PhpOffice\PhpWord\IOFactory::createWriter($wordPdf , 'PDF');
if (file_exists($filename.".pdf")) unlink($filename.".pdf");
$pdfWriter->save($filename.".pdf");
I know that my problem is library, but i really can't understand where the file of this library is. May be it happens because today for the first time i was trying to work with composer. I tried different library like dompdf and TCPDF and my be some others. So if you have any ideas welcome.=)