Forum


Replies: 10   Views: 6851
Dynamic fields with default docx template
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 admin  · 17-02-2016 - 13:27

Hello,

You need to include the DOMPDF lib (it's included within the package in the lib folder):

require_once 'classes/TransformDoc.inc';
require_once 'lib/pdf/dompdf_config.inc.php';

$transform = new TransformDoc();
$transform->setstrFile('Text.docx');
$transform->generatePDF();

Note you need to redirect the output of this command to save the PDF:

$ php test.php > Test.pdf

or through ob_ functions of PHP.

And as explained it only returns a good output for very simple documents. The recommended approach is using the conversion plugin.

Regards.