Forum


Replies: 2   Views: 4426
Docx not saved to file but displayed in cli
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 rbardoel  · 24-05-2018 - 19:09

I tried to load a template from a database as described in this example:

https://www.phpdocx.com/documentation/cookbook/improve-phpdocx-performance

The script is run from command line. When I ran the code below, the docx seems to be dsplayed within the cli instead of being written to file:

$docxContent = $row['data'];
$data = base64_decode($docxContent);
$docxStructure = unserialize($data);
$docx = new Phpdocx\Create\CreateDocxFromTemplate($docxStructure);
$docx->enableCompatibilityMode();
$docx->createDocx('test');

Is this is a bug or am I overlooking something? Streaming is enabled, license is premium. Thank you in advance!