PHPackages                             lmerotta/docx - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. lmerotta/docx

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

lmerotta/docx
=============

PHP Based Docx Parser, based on original work by PhilGale92/docx

0.1.1(10y ago)09631MITPHP

Since May 30Pushed 10y ago2 watchersCompare

[ Source](https://github.com/lmerotta/docx)[ Packagist](https://packagist.org/packages/lmerotta/docx)[ RSS](/packages/lmerotta-docx/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (4)Used By (0)

Docx Parser
===========

[](#docx-parser)

This PHP based parser takes any docx file, and creates a PHP array containing its structure, content &amp; style information. Simply import any style data (as demonstrated within index.php) using the word style name &amp; any desired attributes and run the parser.

====

Supports:

- Word styles
- Paragraphs
- Text indentation / tabbing
- Nested lists (&amp; inline lists)
- Tables (Vertical cell merging + colspans)
- Images (&amp; finding the required image size)
- Hyperlinks (With mailto: support)
- Bold / Underlined / Italic text
- Textboxes (Parser support added, but not rendered)
- Table of content functionality (You likely need to extend the docx class &amp; modify the -&gt;render() class)

====

Known Bugs:

- Tables cells that us the following pattern don't render properly:

Example (incorrect render)cell 1cell 2--------cell 3cell 4Cell 1 + 2 are vertically merged. Then there is a border, cell 3 + 4 are merged. The renderer cannot differentiate between multiple vertical merges that don't have a standard cell between them.

The following layout is fine, as cell 3 is a standard cell dividing the two vertical merges:

Example (works)cell 1cell 2--------cell 3--------cell 4cell 5====

Caveats:

- Images are displayed at the same dimensions as in word, however the included rendering class does not contain functionality for resizing the raw image files as required (due to it being out of scope for this project)
- The parser may take some time to run on larger documents
- Modifying text in word to look the same as a header style is not the same as setting its stylename to 'header'

====

Requirements:

- PHP 5.3 or greater
- /tmp writable by PHP

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Total

2

Last Release

3670d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/152471521?v=4)[lmerotta](/maintainers/lmerotta)[@lmerotta](https://github.com/lmerotta)

---

Top Contributors

[![PhilGale92](https://avatars.githubusercontent.com/u/2852603?v=4)](https://github.com/PhilGale92 "PhilGale92 (13 commits)")[![hezll](https://avatars.githubusercontent.com/u/1241715?v=4)](https://github.com/hezll "hezll (3 commits)")

### Embed Badge

![Health badge](/badges/lmerotta-docx/health.svg)

```
[![Health](https://phpackages.com/badges/lmerotta-docx/health.svg)](https://phpackages.com/packages/lmerotta-docx)
```

###  Alternatives

[mck89/peast

Peast is PHP library that generates AST for JavaScript code

19139.2M47](/packages/mck89-peast)[sauladam/shipment-tracker

Parses tracking information for several carriers, like UPS, USPS, DHL and GLS by simply scraping the data. No need for any kind of API access.

9843.5k](/packages/sauladam-shipment-tracker)[jstewmc/rtf

Read and write Rich Text Format (RTF) documents with PHP

45153.1k6](/packages/jstewmc-rtf)[tcds-io/php-jackson

A lightweight, flexible object serializer for PHP, inspired by FasterXML/jackson

113.2k10](/packages/tcds-io-php-jackson)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
