Hello,
Word has some limitations when adding content that must be autoupdated outside header and footer contents. And it may require pressing F9 to update it.
We recommend you to use headers or footers for this kind of content.
You also can use a template instead of the default empty document. You can create a DOCX that include the numbering, and use it as a template (using the CreateDocxFromTemplate class) adding new content and replace existing placeholders.
Or you can use the addSimpleField method to get the number of pages:
http://www.phpdocx.com/api-documentation/word-content/add-a-field-to-the-Word-document
Regards.