indexer
- 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
- 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
indexer
![](/img/preview/methods_check.png)
![](/img/preview/methods_X.png)
Parses Word documents and return their contents.
Description
Indexer (mixed $source)
This class parses the content of DOCX documents and returns an array with these contents:
- body
- charts
- images
- fields
- links
- text
- comments
- images
- links
- text
- endnotes
- images
- links
- text
- fonts
- footers
- images
- links
- text
- footnotes
- images
- links
- text
- headers
- images
- links
- text
- information
- people
- properties
- core
- custom
- sections
- signatures
- sources
- styles
- docDefaults
- heading
- numbering
- style
Parameters
source
The path to the Word document to be parsed (Advanced and Premium licenses) or a DOCXStructure object (Premium licenses).
Return values
array or json
Exceptions
Error while trying to open the (base) template as a zip file.
Code samples
Example #1:
Release notes
- phpdocx 14.5:
- heading style names, input fields and merge fields.
- phpdocx 13.5:
- extra information (variant, macros...).
- get paragraph tags to avoid extra empty blank spaces returning text contents.
- phpdocx 12.0:
- signatures and sources.
- phpdocx 11.0:
- online images.
- phpdocx 10.0:
- link contents from rels files.
- alt text titles and description contents from images.
- phpdocx 9.0:
- people, sections and styles.
- in-memory DOCX documents.
- phpdocx 8.5:
- fonts.
- phpdocx 7.0:
- image sizes.
- charts.
- document properties.
- phpdocx 6.5:
- new method.