Converting docx to pdf with same style by PHPWord

Hi,
I am using phpword to create a docx file from a given docx template.
This is working good.
But I need the same look and format of created docx file in pdf.
When I do this with the following code then I am getting an pdf file but with noch style.

Is there a way to have the same look and feel for the pdf file from docx.
I will appreciate any hint to have this issue solved.

.....
$templateProcessor->saveAs('./mpol/RechnungNr_'.$RechId.'.docx');

\PhpOffice\PhpWord\Settings::setPdfRendererPath('vendor/hkvstore/dompdf');
\PhpOffice\PhpWord\Settings::setPdfRendererName('DomPDF');
$phpWord = \PhpOffice\PhpWord\IOFactory::load('./mpol/RechnungNr_'.$rowR["Id"].'.docx');
$xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord,'PDF');
$xmlWriter->save('./mpol/RechnungNr_'.$rowR["Id"].'.pdf');  // Save to PDF

mpol_ch

Google php convert word to pdf with style.

hi,
would that mean I must install another converting tool?
Do you have a suggestion?
thanksmpol_ch

I don’t thinks so.

If you search via Google by using the keywords I mentioned above, you will find that this is one of the issues in PHPWord extension: