The document is generated by a template.The PHP script basically replaces a large number of variables - either using the replaceVariableByText () function or the replaceVariableByExternalFile () function - and eventually deletes some blocks.
I would like to avoid having to put the table of contents at the bottom of the document, as I currently did:
$ docx-> addTableContents (array ('autoUpdate' => true), $ legend);
$ Docx-> clearBlocks ();
$ docx-> createDocx ('./ test / offer'. $ variables ['VAR_OFFER_NUMBER']);
For me it would be ideal to insert the table of contents on the second page, but taking the first from the template.I hope I was able to explain: I would not, if possible, have to do the first page "line by line" from PHP.