Forum


Replies: 4   Views: 1212
Unable to view real stats file
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  · 27-08-2021 - 11:28

Hello,

The getDocxProperties method returns the information from the XML properties in a DOCX document. These values are fixed and saved in the DOCX document by MS Word or LibreOffice (phpdocx doesn't change them), so if you read them directly they may not correspond with the real contents.

If you want to calculate the pages, lines and other values dynamically from a DOCX document you need to use the getStatistics method (https://www.phpdocx.com/api-documentation/format-conversion/get-Word-statistics-content). Please check the docs (macros-libreoffice since phpdocx 10) folder included in the package, where you can read all information about this method and how to use it.

You can get statistics too (not number of page/line values) using Indexer (https://www.phpdocx.com/api-documentation/docxutilities/indexer-parse-word-documents-with-PHP) or the getDocxPathQueryInfo method that only requires PHP: number of paragraphs, images, tables...

Regards.