Forum


Replies: 5   Views: 3097
Generating toc using templates and embedhtml
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  · 31-10-2017 - 05:50

Hello,

The CreateDocxFromTemplate class inheritances CreateDocx, so you can use the same methods.

There's a documentation page about the ways to generate DOCX files with phpdocx:

https://www.phpdocx.com/documentation/cookbook/add-contents-document-types

Anyway if you are using a template, the easiest approach is adding the TOC using MS Word and the fill it using phpdocx (adding contents that are supported in the display levels). The previous script was just an example to illustrate how headings are added to the TOC.

Regards.