https://github.com/jupitern/docx
docx tools - template engine, merge docx files
https://github.com/jupitern/docx
docx docx-template php php-docx
Last synced: 4 months ago
JSON representation
docx tools - template engine, merge docx files
- Host: GitHub
- URL: https://github.com/jupitern/docx
- Owner: jupitern
- License: mit
- Created: 2016-02-15T10:27:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-02-28T18:44:29.000Z (over 1 year ago)
- Last Synced: 2025-10-18T03:36:37.980Z (8 months ago)
- Topics: docx, docx-template, php, php-docx
- Language: PHP
- Homepage:
- Size: 28.3 KB
- Stars: 16
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jupitern/docx
#### PHP Docx tolls.
- docx template system
- merge docx files on one file
- optionally add page break between merged files
## Requirements
PHP 5.4 or higher.
## Installation
Include jupitern/docx in your project, by adding it to your composer.json file.
```javascript
{
"require": {
"jupitern/docx": "1.*"
}
}
```
## Usage
```php
$dir = 'C:\\www\\docx\\';
// Docx template
$docx = \Jupitern\Docx\Docx::instance()
->setTemplate($dir.'template.docx')
->setData(['{name}' => 'john doe', '{address}' => 'at the end of the road'])
->save($dir.'result.docx');
// Merge Docx files
$docxMerge = \Jupitern\Docx\DocxMerge::instance()
// add array of files to merge
->addFiles([$dir.'file1.docx', $dir.'file2.docx'])
// output filepath and pagebreak param
->save($dir.'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