getStatistics
- addBibliography
- addBookmark
- addBreak
- addChart
- addCitation
- addComment
- addCrossReference
- addDateAndHour
- addEndnote
- addExternalFile
- addFootnote
- addFormElement
- addHeading
- addImage
- addLink
- addList
- addMathEquation
- addMergeField
- addOLE
- addOnlineVideo
- addPageNumber
- addShape
- addSimpleField
- addSource
- addStructuredDocumentTag
- addSVG
- addTab
- addTable
- addTableContents
- addTableFigures
- addText
- addTextBox
- addWordFragment
- addWordML
- embedHTML
- addBackgroundImage
- addFooter
- addFooterSection
- addHeader
- addHeaderSection
- addLineNumbering
- addMacroFromDoc
- addPageBorders
- addProperties
- addSection
- createDocx
- createDocxAndDownload
- createCharacterStyle
- createListStyle
- createParagraphStyle
- createTableStyle
- docxSettings
- embedFont
- importChartStyle
- importHeadersAndFooters
- importListStyle
- importStyles
- importStylesWordDefault
- modifyPageLayout
- parseStyles
- removeFooters
- removeHeaders
- setBackgroundColor
- setDecimalSymbol
- setDefaultFont
- setDocumentDefaultStyles
- setEncodeUTF8
- setLanguage
- setMarkAsFinal
- setRTL
- clearBlocks
- cloneBlock
- deleteBlock
- getTemplateVariables
- getTemplateVariablesType
- modifyInputFields
- modifyMergeFields
- processTemplate
- removeTemplateVariable
- removeTemplateVariableImage
- replaceBlock
- replaceListVariable
- replacePlaceholderImage
- replaceTableVariable
- replaceVariableByExternalFile
- replaceVariableByHtml
- replaceVariableByText
- replaceVariableByWordFragment
- replaceVariableByWordML
- setTemplateSymbol
- setTemplateBlockSymbol
- tickCheckboxes
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.