PHPackages                             mrdreek/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. mrdreek/docx-merge

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

mrdreek/docx-merge
==================

Fork of simple library for merging multiple MS Word ".docx" files into one

v1.2.0(5y ago)05.7k↓33.3%[1 issues](https://github.com/MrDreek/DocxMerge/issues)MITPHPPHP ^8.0

Since Nov 3Pushed 5y agoCompare

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

READMEChangelog (4)Dependencies (1)Versions (7)Used By (0)

Fork DocxMerge library
======================

[](#fork-docxmerge-library)

orginal

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)

```
composer require mrdreek/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"
    );
```

Merge Example with page breaks
------------------------------

[](#merge-example-with-page-breaks)

each new file will be from a new page

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

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

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

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 72% 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 ~399 days

Recently: every ~465 days

Total

6

Last Release

1852d ago

PHP version history (3 changes)v1.0.0PHP &gt;=5.3.0

v1.1.0PHP ^7.4

v1.2.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/11575687?v=4)[Nikita Klyosow](/maintainers/MrDreek)[@MrDreek](https://github.com/MrDreek)

---

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)")[![MrDreek](https://avatars.githubusercontent.com/u/11575687?v=4)](https://github.com/MrDreek "MrDreek (3 commits)")

---

Tags

docxmergeplaceholder

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[iio/libmergepdf

Library for merging multiple PDFs

40813.6M13](/packages/iio-libmergepdf)[krustnic/docx-merge

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

61193.9k](/packages/krustnic-docx-merge)[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)

PHPackages © 2026

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