PHPackages                             defstudio/template-processor - 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. [File &amp; Storage](/categories/file-storage)
4. /
5. defstudio/template-processor

ActiveLibrary[File &amp; Storage](/categories/file-storage)

defstudio/template-processor
============================

.odt to .odt/.docx/.doc/.pdf template processor and exporter

v0.3.4(2y ago)0852MITPHPPHP ^8.1CI passing

Since Feb 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/defstudio/template-processor)[ Packagist](https://packagist.org/packages/defstudio/template-processor)[ RSS](/packages/defstudio-template-processor/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (3)Versions (20)Used By (0)

### lowriter installation on docker

[](#lowriter-installation-on-docker)

```
ARG ENABLE_LIBREOFFICE_WRITER=0
RUN if [ ${ENABLE_LIBREOFFICE_WRITER} = 1 ] ; then \
    mkdir -p /usr/share/man/man1 \
    && mkdir -p /.cache/dconf && chmod -R 777 /.cache/dconf \
    && apt-get update \
    && apt-get install -y --no-install-recommends openjdk-11-jre-headless \
    && apt-get install -y --no-install-recommends libreoffice-writer \
    && apt-get install -y --no-install-recommends libreoffice-java-common ;\
fi;
```

### Usage

[](#usage)

```
use DefStudio\TemplateProcessor\Elements\Image;Template::from($dock_template_path)
        ->compile([
            // will replace all instances of ${single_key} with BAR
            'single_key' => 'BAR',

            // and will repeat the block enclosed by ${array_key}[...]${/array_key}
            'array_key' => [
                ['name' => 'paul', 'age' => '36'],  // with the name and age of each element of the array
                ['name' => 'john', 'age' => '24'],
                ['name' => 'ringo', 'age' => '48'],
                ['name' => 'george', 'age' => '22']
            ],

            // will replace an image named ${signature} with the one passed as argument
            // you can set the image name with [right click on image]→properties→options→Name
            'signature' => new Image(path: '/var/www/storage/app/signature.png', keep_ratio: true))
        ])

        // Each action can be done as a standalone call
        ->set('single_key', 'Bar')
        ->clone(block_name: 'users', variable_replacements: [
            ['name' => 'paul', 'age' => '36'],
            ['name' => 'ringo', 'age' => '48'],
            ['name' => 'george', 'age' => '22'],
        ])
        ->insert_image('signature', new Image(path: '/var/www/storage/app/signature.png', keep_ratio: true))

        //add ->to_pdf() to convert to .pdf, otherwise an .odt file will be built
        ->to_pdf()

        // stores the document in a file
        ->store($output_file)

        // or returns a BinaryFileResponse
        ->download($dowloaded_file_name)
```

### notes

[](#notes)

- template processor tries to cleanup its variables/block identifiers, if it is failing the detection, make sure to select and apply "cancel formatting" to them

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 86.3% 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 ~57 days

Recently: every ~171 days

Total

19

Last Release

928d ago

PHP version history (2 changes)v0.0.1PHP ^8.0

v0.3.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/db5e0ab5568062368a52c61d67381c1a35be5e5c816968dd3883bc7ba2d46b53?d=identicon)[fabio.ivona](/maintainers/fabio.ivona)

---

Top Contributors

[![fabio-ivona](https://avatars.githubusercontent.com/u/8792274?v=4)](https://github.com/fabio-ivona "fabio-ivona (44 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![MarioGattolla](https://avatars.githubusercontent.com/u/94918437?v=4)](https://github.com/MarioGattolla "MarioGattolla (2 commits)")

### Embed Badge

![Health badge](/badges/defstudio-template-processor/health.svg)

```
[![Health](https://phpackages.com/badges/defstudio-template-processor/health.svg)](https://phpackages.com/packages/defstudio-template-processor)
```

###  Alternatives

[laravel/horizon

Dashboard and code-driven configuration for Laravel queues.

4.1k91.3M280](/packages/laravel-horizon)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[illuminate/queue

The Illuminate Queue package.

20432.2M1.5k](/packages/illuminate-queue)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[spatie/laravel-export

Create a static site bundle from a Laravel app

672139.5k6](/packages/spatie-laravel-export)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

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