PHPackages                             elysio/easy-pdf - 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. [PDF &amp; Document Generation](/categories/documents)
4. /
5. elysio/easy-pdf

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

elysio/easy-pdf
===============

Library for creating PDFs with Blade templates and a highly performant tool.

1.0.0(1y ago)01MITPHP

Since Dec 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Refaltor77/EasyPDF)[ Packagist](https://packagist.org/packages/elysio/easy-pdf)[ RSS](/packages/elysio-easy-pdf/feed)WikiDiscussions main Synced 1mo ago

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

EasyPdf
=======

[](#easypdf)

`EasyPdf` is a library that enables the creation of PDFs using Blade templates and the Mpdf library. It provides an easy-to-use interface for generating PDFs from Blade views, with options for saving or streaming the generated PDF.

Features
--------

[](#features)

- **Blade Template Integration**: Use Blade templates to generate HTML content for PDFs.
- **Mpdf Integration**: Leverage Mpdf for high-performance PDF generation.
- **Save or Stream PDFs**: Save PDFs to a file or stream them directly to the browser.

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

[](#installation)

You can install the package via Composer:

```
composer require elysio/easy-pdf
```

Usage
-----

[](#usage)

### Initialize the EasyPdf instance

[](#initialize-the-easypdf-instance)

To initialize the `EasyPdf` class, you can either use the constructor directly or the static `init` method.

```
use elysio\easypdf\EasyPdf;

$pdfGenerator = EasyPdf::init('path/to/views', 'path/to/cache');
```

### Generate a PDF

[](#generate-a-pdf)

You can generate a PDF from a Blade view by calling the `makePdf` method. The method takes the name of the Blade view and an optional array of data to be passed to the view.

```
$pdf = $pdfGenerator->makePdf('viewName', ['key' => 'value']);
```

This will return an `Mpdf` instance, which you can use for further operations (e.g., saving or streaming the PDF).

### Save the PDF

[](#save-the-pdf)

To save the generated PDF to a file, use the `savePdf` method:

```
$success = $pdfGenerator->savePdf($pdf, 'path/to/save/document.pdf');
```

### Stream the PDF

[](#stream-the-pdf)

To stream the generated PDF directly to the browser, use the `streamPdf` method:

```
$pdfGenerator->streamPdf($pdf, 'document.pdf');
```

Configuration
-------------

[](#configuration)

The `EasyPdf` class allows you to specify custom paths for the Blade views and cache directories when initializing the instance.

```
$pdfGenerator = EasyPdf::init('custom/views', 'custom/cache');
```

Dependencies
------------

[](#dependencies)

- **mpdf/mpdf**: Required for PDF generation.
- **eftec/bladeone**: Required for Blade templating.

Development
-----------

[](#development)

To run tests during development, use the following command:

```
composer test
```

This will execute the tests using Pest.

License
-------

[](#license)

MIT License. See the [LICENSE](LICENSE) file for more information.

Author
------

[](#author)

**Elysio Martins | Refaltor**
Email:

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance40

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

506d ago

### Community

Maintainers

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

---

Top Contributors

[![Refaltor77](https://avatars.githubusercontent.com/u/77900181?v=4)](https://github.com/Refaltor77 "Refaltor77 (2 commits)")

---

Tags

blade-templatecomposer-packageeasy-pdflaravellaravel-packagelibrarympdfopen-sourcepdfpdf-documentpdf-generationpdf-viewerphpphp-librarytemplate-engin

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/elysio-easy-pdf/health.svg)

```
[![Health](https://phpackages.com/badges/elysio-easy-pdf/health.svg)](https://phpackages.com/packages/elysio-easy-pdf)
```

###  Alternatives

[carlos-meneses/laravel-mpdf

Laravel Mpdf: Using Mpdf in Laravel to generate Pdfs.

4403.1M7](/packages/carlos-meneses-laravel-mpdf)[kartik-v/yii2-mpdf

A Yii2 wrapper component for the mPDF library which generates PDF files from UTF-8 encoded HTML.

1605.5M84](/packages/kartik-v-yii2-mpdf)[contributte/pdf

Pdf response extension for Nette Framework

43967.8k2](/packages/contributte-pdf)[robregonm/yii2-pdf

Yii 2 PDF Response Formatter

4647.5k1](/packages/robregonm-yii2-pdf)[jkuchar/pdfresponse

PdfResponse is wrapper of mPDF for Nette.

10329.4k](/packages/jkuchar-pdfresponse)[famelo/pdf

Provides a quick and simple way to generate a PDF from a Fluid Template through the MPDF library

1872.8k](/packages/famelo-pdf)

PHPackages © 2026

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