-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Hi,
Using the following code the temp file has images and the styles but once converted to pdf images and styles are lost
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$rendererLibraryPath = '../composer/vendor/tecnickcom/tcpdf';
\PhpOffice\PhpWord\Settings::setPdfRendererPath($rendererLibraryPath);
\PhpOffice\PhpWord\Settings::setPdfRendererName('TCPDF');
$templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor('./docs/PurchaseOrderTemplate.docx');
$templateProcessor->setImageValue('logo', './docs/sigtext.png');
$templateProcessor->saveAs('./docs/temp/temp2.docx');
$temp = \PhpOffice\PhpWord\IOFactory::load('./docs/temp/temp2.docx');
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($temp , 'PDF');
$xmlWriter->save('./docs/results/sampledocument.pdf', TRUE);