Replies: 1   Views: 1731
Cross reference tables, images, heading and appendices
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  · 02-08-2019 - 10:31


phpdocx allows using cross-references with bookmarks and headings; headings are used creating a bookmark, so we recommend using bookmarks directly.

As bookmarks and cross-refences can be used as WordFragments you can apply them almost anywhere using the WordFragment methods: creating contents, replacing placeholders ( and DOCXPath (

phpdocx supports adding a caption to images, not to tables or other contents. We move the request to the dev team. If you want to generate them using raw WordML (addWordML), this kind of content is created using a w:fldSimple tag and a text string, in the CreateImageCaption.php file you can see how it's being generated for images.

About getting page numbers you can generate fields but they aren't automatically updated unless they are in headers and footers. This kind of fields may require being updated manually (for example pressing F9) or using a macro.

Adding a content such as a Table of figures is not supported yet, only TOC are supported. Using getDocxPathQueryInfo available in DOCXPath and custom XPath queries you could generate a list contents with links using the bookmark names (addLink), but it's not an easy task.