jupitern/docx

docx tools - template engine, merge docx files

Maintainers

Package info

github.com/jupitern/docx

pkg:composer/jupitern/docx

Statistics

Installs: 154 233

Dependents: 0

Suggesters: 0

Stars: 16

Open Issues: 2

1.2.0 2026-05-18 08:06 UTC

This package is auto-updated.

Last update: 2026-05-18 08:07:32 UTC


README

PHP Docx tolls.

  • docx template system
  • merge docx files on one file
  • optionally add page break between merged files

Requirements

PHP 8.3 or higher.

Installation

Pull the package via composer.

composer require jupitern/docx

Usage

// Docx template
$docx = \Jupitern\Docx\Docx::instance()
			->setTemplate('template.docx')
			->setData(['{name}' => 'john doe', '{address}' => 'at the end of the road'])
			->save('result.docx');

// Merge Docx files
$docxMerge = \Jupitern\Docx\DocxMerge::instance()
    // add array of files to merge
	->addFiles(['file1.docx', 'file2.docx'])
    // output filepath and pagebreak param
	->save('result.docx', true);

Contributing

  • welcome to discuss a bugs, features and ideas.

License

jupitern/docx is release under the MIT license.

You are free to use, modify and distribute this software