PHPackages                             superipey/phpword - 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. superipey/phpword

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

superipey/phpword
=================

Based on PHPOffice/PHPWord, some code modification for Any Image in Document to be recognized in TemplateProcessor

1991PHP

Since Dec 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/superipey/phpword)[ Packagist](https://packagist.org/packages/superipey/phpword)[ RSS](/packages/superipey-phpword/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Modified PHPWord
================

[](#modified-phpword)

This is only Modified PHPWord library based on PHPOffice/PHPWord library. I just put some modification in Word TemplateProcessor to recognize Images as a Template in the Document.

Thank you

Installation
------------

[](#installation)

This library is installed via [Composer](https://getcomposer.org/). To [add a dependency](https://getcomposer.org/doc/04-schema.md#package-links%3E) to PHPWord in your project, either

Run the following to use the latest master version

```
    composer require superipey/phpword:dev-master
```

You can of course also manually edit your composer.json file

```
{
    "require": {
       "superipey/phpword": "dev-master"
    }
}
```

Getting Started
---------------

[](#getting-started)

First Step
----------

[](#first-step)

To try this library modification, first create the template with the image placed anywhere in your document, right click on the image, then select **Format AutoShape/Pictures**[![Figure 1](https://camo.githubusercontent.com/4e15dafccd546f545bbc8ae9191e5aa051e4aad30e1c678700127260bc17d6d0/68747470733a2f2f75796d696b672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d70703070474b546f7659564342527475356a474a6966554a74677533694e6a6e306776456e61636b7a76596e6c61752d49394a3278684e446351677667356f4b5341435947417958474c6a356472634c63324d736151355569417275715f75693556573758367055424f534e662d5f3156636836384d66565f6852446f327078727649374a485936584664634844456b6c6657675064757a56655259414e6e773938626c41574959585934424d7252725158416d756152597853364e50337931574d694369625a50432d3633595f46507947517937773f77696474683d363630266865696768743d3337312663726f706d6f64653d6e6f6e65 "Figure 1")](https://camo.githubusercontent.com/4e15dafccd546f545bbc8ae9191e5aa051e4aad30e1c678700127260bc17d6d0/68747470733a2f2f75796d696b672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d70703070474b546f7659564342527475356a474a6966554a74677533694e6a6e306776456e61636b7a76596e6c61752d49394a3278684e446351677667356f4b5341435947417958474c6a356472634c63324d736151355569417275715f75693556573758367055424f534e662d5f3156636836384d66565f6852446f327078727649374a485936584664634844456b6c6657675064757a56655259414e6e773938626c41574959585934424d7252725158416d756152597853364e50337931574d694369625a50432d3633595f46507947517937773f77696474683d363630266865696768743d3337312663726f706d6f64653d6e6f6e65)

Second Step
-----------

[](#second-step)

Type your fieldname in the **Alternative text**[![Figure 2](https://camo.githubusercontent.com/1ed0a914137ddcd91e827ff3cc7e359b2c7f6e871192da9cdb332bbcf9e9edc3/68747470733a2f2f76636d696b672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5435705638464e537773794e36594c66763072536c332d61694636362d6e6346596649536c49436f6b6f613736755a2d736259415a6e6e4e5a394d4a7074685733586e75694834626a6a564a6c61744d357445704f4d7a47634f674674464562474a6d384b4e4336474d516f63666a556266734b3751775677494f67396957466a307a61646954622d4a616467647979684d4230617379646d554933413479545249574675416d514a33696b363832325942306e6d507165537a557763437635466d6b5144745f6975794f7a4b5a4a79326e784d57413f77696474683d353836266865696768743d3636302663726f706d6f64653d6e6f6e65 "Figure 2")](https://camo.githubusercontent.com/1ed0a914137ddcd91e827ff3cc7e359b2c7f6e871192da9cdb332bbcf9e9edc3/68747470733a2f2f76636d696b672e626e313330332e6c69766566696c6573746f72652e636f6d2f79346d5435705638464e537773794e36594c66763072536c332d61694636362d6e6346596649536c49436f6b6f613736755a2d736259415a6e6e4e5a394d4a7074685733586e75694834626a6a564a6c61744d357445704f4d7a47634f674674464562474a6d384b4e4336474d516f63666a556266734b3751775677494f67396957466a307a61646954622d4a616467647979684d4230617379646d554933413479545249574675416d514a33696b363832325942306e6d507165537a557763437635466d6b5144745f6975794f7a4b5a4a79326e784d57413f77696474683d353836266865696768743d3636302663726f706d6f64653d6e6f6e65)

Third Step
----------

[](#third-step)

Use **setImageValueAlt** to set the image

```
$template->setImageValueAlt(field, path-to-file);
```

Example:

```
$template->setImageValueAlt("foto", "./uploads/foto/ferry.png");
```

License
-------

[](#license)

PHPWord is an open source project licensed under the terms of LGPL version 3. PHPWord is aimed to be a high quality software product by incorporating continuous integration and unit testing. You can learn more about PHPWord by reading the Developers' Documentation and the API Documentation.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f030868dad62f43e60fc202ba29f0dbf323ec5c558c16386fecd577214776962?d=identicon)[superipey](/maintainers/superipey)

---

Top Contributors

[![superipey](https://avatars.githubusercontent.com/u/16450242?v=4)](https://github.com/superipey "superipey (5 commits)")

### Embed Badge

![Health badge](/badges/superipey-phpword/health.svg)

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

###  Alternatives

[phpoffice/phpspreadsheet

PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine

13.9k293.5M1.3k](/packages/phpoffice-phpspreadsheet)[spatie/browsershot

Convert a webpage to an image or pdf using headless Chrome

5.2k32.1M102](/packages/spatie-browsershot)[smalot/pdfparser

Pdf parser library. Can read and extract information from pdf file.

2.7k34.5M216](/packages/smalot-pdfparser)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[openspout/openspout

PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way

1.1k57.6M131](/packages/openspout-openspout)[keboola/csv

Keboola CSV reader and writer

1451.8M21](/packages/keboola-csv)

PHPackages © 2026

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