PHPackages                             jawira/plantuml-to-image - 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. jawira/plantuml-to-image

ActiveLibrary

jawira/plantuml-to-image
========================

PlantUml wrapper to convert puml diagrams to images.

v1.2.0(5mo ago)422.4k↑11.9%[1 issues](https://github.com/jawira/plantuml-to-image/issues)3MITPHPPHP ^8.1CI passing

Since Oct 13Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/jawira/plantuml-to-image)[ Packagist](https://packagist.org/packages/jawira/plantuml-to-image)[ RSS](/packages/jawira-plantuml-to-image/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (13)Used By (3)

PlantUml to image
=================

[](#plantuml-to-image)

**PlantUml wrapper to convert `.puml` diagrams into images.**

[![Latest Stable Version](https://camo.githubusercontent.com/9b910aa2ccbeda296e9f833d92247ac17ec4ec6ce6591cfb2e94d69c3658729c/687474703a2f2f706f7365722e707567782e6f72672f6a61776972612f706c616e74756d6c2d746f2d696d6167652f76)](https://packagist.org/packages/jawira/plantuml-to-image)[![Total Downloads](https://camo.githubusercontent.com/2787d6af6d3dec02b12e5ae8c3e6f5dc060a96365fb957e923a434e8267298ab/687474703a2f2f706f7365722e707567782e6f72672f6a61776972612f706c616e74756d6c2d746f2d696d6167652f646f776e6c6f616473)](https://packagist.org/packages/jawira/plantuml-to-image)[![PHP Version Require](https://camo.githubusercontent.com/f873a7879769554908faa41901750dd35c5eb9ab0efb6e0f4c58311f0ae97ff1/687474703a2f2f706f7365722e707567782e6f72672f6a61776972612f706c616e74756d6c2d746f2d696d6167652f726571756972652f706870)](https://packagist.org/packages/jawira/plantuml-to-image)[![License](https://camo.githubusercontent.com/a57b15c9e48cfa5f0fe9ae645e514e8a05129c54686f9cad36524cbe64bc8654/687474703a2f2f706f7365722e707567782e6f72672f6a61776972612f706c616e74756d6c2d746f2d696d6167652f6c6963656e7365)](https://packagist.org/packages/jawira/plantuml-to-image)

Usage
-----

[](#usage)

This package provides three methods:

1. `\Jawira\PlantUmlToImage\PlantUml::convertTo`
2. `\Jawira\PlantUmlToImage\PlantUml::setJar`
3. `\Jawira\PlantUmlToImage\PlantUml::isPlantUmlAvailable`

### Convert .puml diagram to image

[](#convert-puml-diagram-to-image)

It's up to you to load your diagram from disk, then use `\Jawira\PlantUmlToImage\PlantUml` to convert the diagram to another format, after conversion, it's up to you to save new image to disk:

```
use Jawira\PlantUmlToImage\Format;
use Jawira\PlantUmlToImage\PlantUml;

// Load diagram
$puml = file_get_contents('./diagram.puml');

// Convert to png
$plantUml = new PlantUml();
$png = $plantUml->convertTo($puml, Format::PNG);

// Save diagram
file_put_contents('./diagram.png', $png);
```

### Set Jar location

[](#set-jar-location)

Specify the location of `plantuml.jar`:

```
$plantUml->setJar('/path/to/plantuml.jar');
```

You don't need to set Jar location in the following cases:

1. You have downloaded PlantUML with [jawira/plantuml](https://github.com/jawira/plantuml), (location `vendor/jawira/plantuml/bin/plantuml.jar`).
2. If you have installed PlantUML with apt-get (location `/usr/share/plantuml/plantuml.jar`).
3. Or if you have `plantuml` command installed.

### Check PlantUml availability

[](#check-plantuml-availability)

An exception is thrown when jar can't be found, use this method to avoid the exception.

```
if ($plantUml->isPlantUmlAvailable()) {
  echo 'PlantUml is available.', PHP_EOL;
} else {
  echo 'Sorry, cannot convert diagram.', PHP_EOL;
}
```

How to install
--------------

[](#how-to-install)

```
$ composer require jawira/plantuml-to-image
```

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

[](#requirements)

This package needs *PlantUml* () as an executable or as a Jar file, note that *PlantUml*has its own requirements ().

As an alternative, you can install *PlantUml* with Composer:

```
$ composer require jawira/plantuml
```

Contributing
------------

[](#contributing)

If you liked this project, ⭐ [star it on GitHub](https://github.com/jawira/plantuml-to-image).

License
-------

[](#license)

This library is licensed under the [MIT license](LICENSE.md).

---

Packages from jawira
--------------------

[](#packages-from-jawira)

 [jawira/doctrine-diagram-bundle ![GitHub stars](https://camo.githubusercontent.com/462206b7e0f2710fb003bb443de5def28346b3391b6914c8e73b83a62ae7bcdf/68747470733a2f2f62616467656e2e6e65742f6769746875622f73746172732f6a61776972612f646f637472696e652d6469616772616d2d62756e646c653f69636f6e3d676974687562)](https://packagist.org/packages/jawira/doctrine-diagram-bundle)Symfony Bundle to generate database diagrams. [jawira/case-converter ![GitHub stars](https://camo.githubusercontent.com/252838515757e452113329ed46602db164b1f5d2575da97f33367c34aa8a0eaf/68747470733a2f2f62616467656e2e6e65742f6769746875622f73746172732f6a61776972612f636173652d636f6e7665727465723f69636f6e3d676974687562)](https://packagist.org/packages/jawira/case-converter)Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation. [more...](https://packagist.org/packages/jawira/)

###  Health Score

47

—

FairBetter than 94% of packages

Maintenance65

Regular maintenance activity

Popularity32

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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 ~104 days

Recently: every ~272 days

Total

12

Last Release

169d ago

Major Versions

v0.2.1 → v1.0.02022-12-06

PHP version history (2 changes)v0.0.0PHP ^7.4 || ^8.0

v1.2.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/496541?v=4)[Jawira Portugal](/maintainers/jawira)[@jawira](https://github.com/jawira)

---

Top Contributors

[![jawira](https://avatars.githubusercontent.com/u/496541?v=4)](https://github.com/jawira "jawira (63 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

phpplantumlpuml

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jawira-plantuml-to-image/health.svg)

```
[![Health](https://phpackages.com/badges/jawira-plantuml-to-image/health.svg)](https://phpackages.com/packages/jawira-plantuml-to-image)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

86910.0M83](/packages/spatie-laravel-health)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[temporal/sdk

Temporal SDK

4002.2M18](/packages/temporal-sdk)[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.

44643.1k1](/packages/pressbooks-pressbooks)[illuminate/process

The Illuminate Process package.

44699.5k65](/packages/illuminate-process)[statamic/cli

Statamic CLI Tool

7587.7k](/packages/statamic-cli)

PHPackages © 2026

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