https://github.com/row-bloom/row-bloom
Powerful and extensible library to render tabular data into templates and generate PDFs
https://github.com/row-bloom/row-bloom
generation html library pdf php rendering spreadsheet
Last synced: 19 days ago
JSON representation
Powerful and extensible library to render tabular data into templates and generate PDFs
- Host: GitHub
- URL: https://github.com/row-bloom/row-bloom
- Owner: row-bloom
- License: mit
- Created: 2023-06-03T14:07:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-01T17:14:03.000Z (over 2 years ago)
- Last Synced: 2025-07-30T02:02:56.780Z (11 months ago)
- Topics: generation, html, library, pdf, php, rendering, spreadsheet
- Language: PHP
- Homepage: https://github.com/row-bloom/row-bloom/wiki
- Size: 839 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Row bloom
[](https://packagist.org/packages/row-bloom/row-bloom)
[](https://github.com/row-bloom/row-bloom/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/row-bloom/row-bloom/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
[](https://packagist.org/packages/row-bloom/row-bloom)
This package is used to generate PDFs using a table of data with one or many rows, and a template that gets applied for each row.
The goal is to allow the usage of any templating engine with any PDF generation library, by abstracting them as drivers and trying to ensure an idempotent output no matter what driver the user picks.

```php
use RowBloom\ChromePhpRenderer\ChromePhpRenderer;
use RowBloom\RowBloom\DataLoaders\FolderDataLoader;
use RowBloom\RowBloom\DataLoaders\JsonDataLoader;
use RowBloom\RowBloom\Interpolators\PhpInterpolator;
use RowBloom\CssLength\PaperFormat;
use RowBloom\RowBloom\Options;
use RowBloom\RowBloom\Support;
$support = (new Support)
->registerDataLoaderDriver(FolderDataLoader::NAME, FolderDataLoader::class)
->registerDataLoaderDriver(JsonDataLoader::NAME, JsonDataLoader::class)
->registerInterpolatorDriver(PhpInterpolator::NAME, PhpInterpolator::class)
->registerRendererDriver(ChromePhpRenderer::NAME, ChromePhpRenderer::class);
$r = rowBloom(support: $support)->rowBloom;
$r->setInterpolator('PHP')->setRenderer('Chrome')
->addTable([
['title' => 'Title1', 'body' => 'body1'],
['title' => 'Title2', 'body' => 'body2'],
])
->setTemplate('
= $title ?>
= $body ?>
')
->addCss('h1 {color: red;}')
->tapOptions(function (Options $options) {
$options->format = PaperFormat::_A4;
$options->displayHeaderFooter = true;
$options->margin = '1 in';
})
->save(__DIR__.'/foo.pdf');
```
## Setup
```bash
composer require row-bloom/row-bloom
```
## Usage
Head over to the [full documentation](https://github.com/row-bloom/row-bloom/wiki).
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.