indexer

indexer

ADVANCED / PREMIUM TRIAL

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 15.5:
    • supported DOCM, DOTM and DOTX files.
  • 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.