PHPackages                             krustnic/docx-merge - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. krustnic/docx-merge

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

krustnic/docx-merge
===================

Simple library for merging multiple MS Word ".docx" files into one

v1.0.1(10y ago)61193.9k—0.2%29[13 issues](https://github.com/krustnic/DocxMerge/issues)[4 PRs](https://github.com/krustnic/DocxMerge/pulls)MITPHPPHP &gt;=5.3.0

Since Nov 3Pushed 1y ago7 watchersCompare

[ Source](https://github.com/krustnic/DocxMerge)[ Packagist](https://packagist.org/packages/krustnic/docx-merge)[ RSS](/packages/krustnic-docx-merge/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

DocxMerge
=========

[](#docxmerge)

Simple library for merging multiple MS Word ".docx" files into one

Features
--------

[](#features)

- Create valid docx for MS Office 2007 and above

Details
-------

[](#details)

- For working with docx's ZIP I'm using [TbsZip](http://www.tinybutstrong.com/apps/tbszip/tbszip_help.html)

Install
-------

[](#install)

```
php composer.phar require krustnic/docx-merge

```

Merge Example
-------------

[](#merge-example)

```
require "vendor/autoload.php";
use DocxMerge\DocxMerge;

$dm = new DocxMerge();
$dm->merge( [
    "templates/TplPage1.docx",
    "templates/TplPage2.docx"
], "/tmp/result.docx" );

```

setValues Example
-----------------

[](#setvalues-example)

```
# Use "${NAME}" in docx file to create placeholders

require "vendor/autoload.php";
use DocxMerge\DocxMerge;

$dm = new DocxMerge();
$dm->setValues( "templates/template.docx",
                "templates/result.docx",
				array( "NAME" => "Sterling", "SURNAME" => "Archer" ) );

```

Or with styles ("bold", "italic", "underline"):

```
$dm->setValues( "templates/template.docx",
                "templates/result.docx",
                [
    			    "NAME" => [
    			        [
                            "value"      => "Sterling",
                            "decoration" => [ "bold", "italic" ]
    			        ],
    			        [
                            "value"      => "Archer",
                            "decoration" => [ "bold", "underline" ]
    			        ]
    			    ]
                ]);

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% 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 ~136 days

Total

2

Last Release

3713d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8bd126b85742263f4a859cac004bd5d656f3cd954e8cb1c08c973904bc24022a?d=identicon)[krustnic](/maintainers/krustnic)

---

Top Contributors

[![krustnic](https://avatars.githubusercontent.com/u/1822176?v=4)](https://github.com/krustnic "krustnic (18 commits)")[![Zlob](https://avatars.githubusercontent.com/u/3818931?v=4)](https://github.com/Zlob "Zlob (4 commits)")

---

Tags

docxmergeplaceholder

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[iio/libmergepdf

Library for merging multiple PDFs

40813.6M13](/packages/iio-libmergepdf)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3685.2M19](/packages/gotenberg-gotenberg-php)[jurosh/pdf-merge

PHP PDF Merger

1522.2M5](/packages/jurosh-pdf-merge)[vaites/php-apache-tika

Apache Tika bindings for PHP: extracts text from documents and images (with OCR), metadata and more...

1171.5M2](/packages/vaites-php-apache-tika)[aspose-cloud/aspose-words-cloud

Open, generate, edit, split, merge, compare and convert Word documents. Integrate Cloud API into your solutions to manipulate documents. Convert PDF to Word (DOC, DOCX, ODT, RTF and HTML) and in the opposite direction.

32157.4k](/packages/aspose-cloud-aspose-words-cloud)[mnvx/lowrapper

PHP wrapper over LibreOffice converter

129190.5k](/packages/mnvx-lowrapper)

PHPackages © 2026

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