PHPackages                             ezprint/docnamic - 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. [Templating &amp; Views](/categories/templating)
4. /
5. ezprint/docnamic

ActiveLibrary[Templating &amp; Views](/categories/templating)

ezprint/docnamic
================

The document template engine

1.0.0.3(5y ago)017MITPHPPHP &gt;=5.5

Since May 30Pushed 5y agoCompare

[ Source](https://github.com/ezPrint/docnamic)[ Packagist](https://packagist.org/packages/ezprint/docnamic)[ RSS](/packages/ezprint-docnamic/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

Docnamic - The document template engine
=======================================

[](#docnamic---the-document-template-engine)

Docnamic is a template engine for OpenDocument files (\*.odt) based on PHP's DOM and ZIP extensions. My goal is to provide a simple document generation library whose templates can be easily created using standard WYSIWYG OpenDocument software. I am interested if this library is useful for anybody out there and i will appreciate any feedback on Github or via email.

Please note that the public API should not be considered stable yet.

I will add tests once i am sure about the internal class interfaces.

Requirements
------------

[](#requirements)

- PHP 5.6 or later
- DOM extension
- ZIP extension

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

[](#installation)

Install this library via composer.

```
$ composer require mklocke/docnamic
```

Usage
-----

[](#usage)

Have a look at the folder `examples` which contains examples of how the library should be used.

```
$renderer = new Renderer();
$renderer->loadTemplate('template.odt')
         ->setData(['foo' => 'bar'])
         ->render('result.odt');
```

Convert to PDF
--------------

[](#convert-to-pdf)

The resulting OpenDocument files can be easily converted to PDF using the `unoconv` CLI tool on most linux distributions.

Installation on Ubuntu: `sudo apt-get install unoconv`

Convert a ODT file to PDF: `unoconv -f pdf -o result.pdf result.odt`

FAQ
---

[](#faq)

- Can i use barcodes or QR Codes?

    Yes, you can by using barcode fonts in your document template. OpenDocument files can have embedded fonts. If you use LibreOffice for creating your document templates, read their help pages regarding [Embedding Fonts](https://help.libreoffice.org/Common/Embedding_Fonts)
- Can i use nested loops in my document template?

    No, for now nested loops are not supported.
- Can i use dynamic images?

    No, dynamic images are not supported yet.
- What about encodings?

    As OpenDocument is a UTF-8-based XML file format, your data should be UTF-8 encoded as well ;)
- What about i18n or l10n?

    As this is a rather simple template engine, it has no notion of languages, countries or currencies. This has be taken care of the integrating application.

Inspired by
-----------

[](#inspired-by)

- [Secretary](https://github.com/christopher-ramirez/secretary)
- [docxtemplater](https://github.com/open-xml-templating/docxtemplater)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~154 days

Total

4

Last Release

2079d ago

### Community

Maintainers

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

---

Top Contributors

[![alanmastro](https://avatars.githubusercontent.com/u/1149924?v=4)](https://github.com/alanmastro "alanmastro (2 commits)")[![joinsrl](https://avatars.githubusercontent.com/u/204360736?v=4)](https://github.com/joinsrl "joinsrl (2 commits)")[![mariusklocke](https://avatars.githubusercontent.com/u/7437495?v=4)](https://github.com/mariusklocke "mariusklocke (1 commits)")

---

Tags

odtOpenDocumenttemplating

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/ezprint-docnamic/health.svg)

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

###  Alternatives

[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.5k34.7M186](/packages/phpoffice-phpword)[tinybutstrong/opentbs

With OpenTBS you can merge LibreOffice, OpenOffice and Ms Office documents with PHP using the TinyButStrong template engine. Simple use LibreOffice, OpenOffice or Ms Office to edit your templates : DOCX, XLSX, PPTX, ODT, OSD, ODP and other formats.

82751.1k1](/packages/tinybutstrong-opentbs)

PHPackages © 2026

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