getStatistics

getStatistics

ADVANCED / PREMIUM TRIAL

Counts and prints the number of pages, words, characters, paragraphs, lines, tables and images of a DOCX.

Description
public getStatistics (string $source)

This method uses the conversion plugins (LibreOffice or MS Word) to count and print the number of: pages (LibreOffice and MS Word), words (LibreOffice and MS Word), characters (LibreOffice and MS Word), paragraphs (LibreOffice and MS Word), lines (LibreOffice and MS Word), tables (LibreOffice) and images (LibreOffice) of a DOCX.

Parameters

source

Path to the DOCX to get its statistics.

Return values

array

Code samples

Example #1

Example #2

Release notes
  • phpdocx 10.0:
    • supported MS Word conversion plugin.
    • return an Exception if the stats file can't be created.
  • phpdocx 5.5:
    • new method.