PHPackages                             workdevelop/presentation-replacer - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. workdevelop/presentation-replacer

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

workdevelop/presentation-replacer
=================================

This package replaces pre-defined variables in presentations with data

v0.0.9(5y ago)018.7k↓31.5%MITPHP

Since Apr 22Pushed 5y ago1 watchersCompare

[ Source](https://github.com/workdevelop/PresentationReplacer)[ Packagist](https://packagist.org/packages/workdevelop/presentation-replacer)[ RSS](/packages/workdevelop-presentation-replacer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)DependenciesVersions (10)Used By (0)

PRESENTATION REPLACER
=====================

[](#presentation-replacer)

Annotation
----------

[](#annotation)

This package replaces pre-defined variables in presentations with data This package is suitable not only for vitalize presentation templates, but also for any other zip archives with files, contained pre-defined strings printing\_args

Example
-------

[](#example)

File example.pptx is template and has pre-defined variables at some src file
chart2\_datatype1\_0, chart2\_datatype1\_1, chart2\_datatype1\_2 like this [![](https://camo.githubusercontent.com/f70cccd1ca03c72f52ca285714bcc375f6a3fe50c58a9c41174cf0179e49c8e9/687474703a2f2f692e696d6775722e636f6d2f70336c335956352e706e67)](https://camo.githubusercontent.com/f70cccd1ca03c72f52ca285714bcc375f6a3fe50c58a9c41174cf0179e49c8e9/687474703a2f2f692e696d6775722e636f6d2f70336c335956352e706e67)

Preparation

```
$createPresentation = new \PresentationReplacer\CreatePresentation();
$templatePath = __DIR__.'/../storage/example.pptx';
$resultPath = __DIR__.'/../storage/result/result'.date('Ymd_His').'.pptx';
$createPresentation->setTemplatePath($templatePath);
$createPresentation->setResultPath($resultPath);
$createPresentation->setVariableRegex('/(\{char.*?\})/');
```

Get pre-defined variables at presentation

```
try {
    $allVariables = $createPresentation->getAllVariablesAtPresentation();
} catch (PresentationReplacer\PptException $exception) {
    //do something
}
```

To replace pre-defined variable real data and download

```
try {
    $createPresentation->replaceVariables([
        '{chart2_datatype1_0}' => 500,
        '{chart2_datatype1_1}' => 501
        '{chart2_datatype1_2}' => 100
    ]);
} catch (PresentationReplacer\PptException $exception) {
    //do something
}
$createPresentation->download('ready_presentation.pptx');
```

Get file content at presentation

```
try {
    $chartContent = $createPresentation->getFileContentByRelativePath('ppt/charts/chart1.xml');
} catch (\PresentationReplacer\PptException $exception) {
    //do something
}
```

Set file content at presentation

```
try {
    $createPresentation->setFileContentByRelativePath('ppt/charts/chart1.xml', $chartContent);
} catch (\PresentationReplacer\PptException $exception) {
    //do something
}
```

If you need replace file by Path, such as image
You know relative file pat which was replaced('ppt/media/image2.png')
And you have Absolute path to file where is new image located

```
$logoPath = __DIR__.'/../storage/image.png';
try {
    $createPresentation->setFileContentByRelativePath('ppt/media/image2.png', $logoPath);
} catch (\PresentationReplacer\PptException $exception) {
    //do something
}
```

How to prepare presentation template
------------------------------------

[](#how-to-prepare-presentation-template)

coming soon

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.9% 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 ~40 days

Recently: every ~79 days

Total

9

Last Release

1894d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3eb605260784cb1ff50a90d1632a2c0523fe2aeb7bba3b9187b6418cfc89d2a7?d=identicon)[workdevelop](/maintainers/workdevelop)

---

Top Contributors

[![workdevelop](https://avatars.githubusercontent.com/u/60363564?v=4)](https://github.com/workdevelop "workdevelop (8 commits)")[![Perebyinis](https://avatars.githubusercontent.com/u/25528659?v=4)](https://github.com/Perebyinis "Perebyinis (1 commits)")

---

Tags

phpzippptxPowerPointodppresentation

### Embed Badge

![Health badge](/badges/workdevelop-presentation-replacer/health.svg)

```
[![Health](https://phpackages.com/badges/workdevelop-presentation-replacer/health.svg)](https://phpackages.com/packages/workdevelop-presentation-replacer)
```

###  Alternatives

[phpoffice/phppresentation

PHPPresentation - Read, Create and Write Presentations documents in PHP

1.4k2.4M25](/packages/phpoffice-phppresentation)[pclzip/pclzip

A PHP library that offers compression and extraction functions for Zip formatted archives

19412.9M4](/packages/pclzip-pclzip)[mmoreram/extractor

Extractor project for php

21132.0k8](/packages/mmoreram-extractor)

PHPackages © 2026

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