Forum


Replies: 2   Views: 388
Using wordfragment and addformelement with addtable
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  · 07-11-2023 - 11:15

Hello,

Please note that the time needed to generate a DOCX is not related to the file size but to the contents.

The addTable method is the line that takes more time in your script. Your code is generating a table with 1250 complex contents (WordFragments) that generate 70.000 internal XML lines that must be filled, parsed and cleaned. We have run your code using a test server and it takes 4s to process the whole table and generate the DOCX.
There's no way to improve the taken time to run the script but adding smaller tables instead of a huge table. Instead of one big table, you could generate five smaller tables (each table with 50 rows) to improve the performace.

Regards.