Forum


Replies: 9   Views: 1605
How to use the streammode?
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 pwctechnicalsecurity  · 01-04-2021 - 20:11

 

I am doing a procedure, where (simply put), I follow the example as outlined in phpdocx/examples/DocxUtilities/mergeDocx/sample_2.php.

Roughly:

CreateDocx::$returnDocxStructure = true;
$docx = new CreateDocxFromTemplate($manifest->canvas->word_file_path);
Simple operations (generally adding sequences through EmbedHTML). The DocX is pushed into an array.
Above two steps are done two more times.
// Compose Word document from queue
$first = $queue->shift();

$merge = new MultiMerge();

CreateDocx::$streamMode = true;

return $merge->mergeDocx($first, $queue->toArray(), 'docs/example.docx', array('mergeType' => 0));

In case I set CreateDocx::$streamMode = true; I get the following issues when opening Word. In case I don't set streamMode, there are no issues. Any suggestions?

Word found unreadable content in "docs_example (2).docx". Do you want to recover the contents of this document? If you trust the source of this document, click Yes.

When clicking Yes, I get another dialog box that shows the repairs:

Word detected and repaired the following errors. To view each repair, select it in the list, then click Go To. Save the document to make the repairs permanent.

A listbox that shows "Styles1"

If I want to view the repair, by clicking Go To, it states: This bookmark does not exist.