Forum


Replies: 7   Views: 841
Transform document to pdf
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by calcina  · 30-08-2022 - 16:42

Well, now with the previous version of dompdf the conversion to PDF does work for me, but it still doesn't keep the original design such as typography, borders, orientation and settings in general.

In my particular case, I have a template .docx

$docx = new Phpdocx\Create\CreateDocxFromTemplate('InvoiceTemplate.docx');

Replace some variables

$docx->replaceVariableByText($variablesFooters, $options);

Then convert to PDF, without losing any style, keeping everything in its original appearance.

$docx->transformDocument('Invoice.docx', 'Invoice.pdf');

What solution could help me specifically?
Is libreoffice the only one that could help me?