Reputation: 97
When I use Phpword function addTOC
, it is not displaying the page numbers.
// add table of contents
$section->addTOC();
Upvotes: 0
Views: 790
Reputation: 8228
you need to include the following:
$phpWord->getSettings()->setUpdateFields(true);
this will prompt the user to update the ToC when they open the file (saving it will then store the page numbers)
Upvotes: 1