Couldn't able to generate PDF from .docx using PHPWord
<p>I'm using PDFWord for generating a dynamic document. The .docx and .html is generating perfectly but I'm not able to generate .pdf <em>(I've tried both DomPDF and TCPDF)</em>. </p>

<p>Here is my code sample:</p>

<pre><code>// Saving the document as OOXML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'Word2007');
$objWriter-&gt;save('documents/RFP_for_'.str_replace(' ', '_', $info[org_name]).'.docx');

// Saving the document as HTML file...
$objWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, 'HTML');
$objWriter-&gt;save('documents/RFP_for_'.$info[org_name].'.html');

// Saving the document as PDF file...
\PhpOffice\PhpWord\Settings::setPdfRendererPath('vendor/tcpdf');
\PhpOffice\PhpWord\Settings::setPdfRendererName('TCPDF');

$template-&gt;saveAs('documents/'.$file_name.'.docx');
$temp = \PhpOffice\PhpWord\IOFactory::load('documents/'.$file_name.'.docx');
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($temp , 'PDF');
$xmlWriter-&gt;save('documents/'.$file_name.'.pdf', TRUE);
</code></pre>