PHPackages                             eve/pdf-converter - 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. eve/pdf-converter

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

eve/pdf-converter
=================

Laravel package to convert HTML to PDF, supporting multiple drivers.

v1.1.0(4y ago)114.1k1MITPHPPHP ^8.0

Since Nov 24Pushed 4y ago5 watchersCompare

[ Source](https://github.com/Eveio/pdf-converter)[ Packagist](https://packagist.org/packages/eve/pdf-converter)[ RSS](/packages/eve-pdf-converter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (8)Versions (4)Used By (0)

eve/pdf-converter [![Main](https://github.com/Eveio/pdf-converter/actions/workflows/main.yml/badge.svg)](https://github.com/Eveio/pdf-converter/actions/workflows/main.yml)
===========================================================================================================================================================================

[](#evepdf-converter-)

A Laravel package to help convert HTML to PDF. Supports multiple drivers.

Requirements and Installation
-----------------------------

[](#requirements-and-installation)

eve/pdf-converter requires Laravel 8.x and PHP 8.x. You can install the package via Composer:

```
composer require eve/pdf-converter
```

Next, publish the config file:

```
php artisan vendor:publish --provider="Eve\PdfConverter\ServiceProvider"
```

A `pdf_converter.php` file will be copied into your application's `config` folder.

Usage
-----

[](#usage)

eve/pdf-converter supports 4 drivers, which can be configured in `.env` with the `PDF_CONVERTER_DRIVER` key:

- `dompdf`: The default. Uses [laravel-dompdf](https://github.com/barryvdh/laravel-dompdf) under the hood.
- `mock`: Always returns a [fixture PDF file](https://github.com/Eveio/pdf-converter/blob/master/storage/mock.pdf). Doesn't do any actual conversion.
- `log`: Logs the input HTML and the output path using Laravel's logger. Doesn't do any actual conversion.
- `pdfcrowd`: Uses the commercial [Pdfcrowd](https://pdfcrowd.com/) service. You'll have to set the `PDFCROWD_USERNAME` and `PDFCROWD_API_KEY` environment variables as well for this driver to work.

Of these drivers, `mock` and `log` are meant for development and/or testing purposes. `dompdf` can be used for production but will most likely require some heavy configuration, when `pdfcrowd` should be the best choice if you're willing to spend some bucks per month.

> As eve/pdf-converter is developed first and foremost for eve's internal use, we don't have plans to add more drivers ourselves. PRs are welcome, though.

Once everything is set, the package is dead-boring. You can use either dependency injection or the facade (or both, depending on how silly you want your codebase to look).

### Dependency Injection

[](#dependency-injection)

Inject `Eve\PdfConverter\PdfConverterInterface` and use it:

```
public function __construct(private \Eve\PdfConverter\PdfConverterInterface $converter)
{
    $this->converter->configure('key', 'value');

    // returns an \Illuminate\Http\File instance
    $this->converter->convertHtml('Hello World', '/path/to/output/file.pdf');
}
```

### Facade

[](#facade)

If you're a fan of [Facades](https://laravel.com/docs/8.x/facades) for whatever reason, eve/pdf-converter provides the `\Eve\PdfConverter\Facades\PdfConverter` facade. This facade is even aliased to `\PdfConverter` for your convenience.

```
public function generateInvoice(): void
{
    \PdfConverter::configure('key', 'value');
    \PdfConverter::convertHtml('Free of charge', '/my/invoice.pdf');
}
```

PDF Conversion Configuration
----------------------------

[](#pdf-conversion-configuration)

If you've been paying notice, the PDF conversion output can be tweaked via the `configure` method:

```
$converter->configure(array|string $key, ...$values);
```

Now, the configuration options for the PDF conversion vary from driver to driver. Specifically:

- For `log` and `mock` drivers, the configurations are completely ignored.
- For `dompdf`, refer to the [available options](https://github.com/barryvdh/laravel-dompdf#using) supported by laravel-dompdf itself.
- For `pdfcrowd`, refer to the [official API reference](https://pdfcrowd.com/doc/api/html-to-pdf/php/). Look for the `setX()` functions. You can then use `X` as the `$key` argument for `configure()` method and whatever `setX()` takes as the `$values`. For example:

    Pdfcrowd's APIeve/pdf-converter counterpart`setPageSize('a4')``configure('PageSize', 'a4')``setFooterHeight('30mm')``configure('FooterHeight', '30mm')``setHttpAuth('hey', 'secret')``configure('HttpAuth', 'hey', 'secret')`

License
-------

[](#license)

MIT.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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

Every ~41 days

Total

3

Last Release

1552d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/376ea0f861faf4e87da5ed1e931109da69b9af9b496eab1463788d421e3c74df?d=identicon)[eveio](/maintainers/eveio)

---

Top Contributors

[![phanan](https://avatars.githubusercontent.com/u/8056274?v=4)](https://github.com/phanan "phanan (7 commits)")

---

Tags

composerlaravelpackagepdfpdf-converterphplaravelpdfconverthtml

### Embed Badge

![Health badge](/badges/eve-pdf-converter/health.svg)

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[laraveldaily/laravel-invoices

Missing invoices for Laravel

1.5k1.3M4](/packages/laraveldaily-laravel-invoices)[gotenberg/gotenberg-php

A PHP client for interacting with Gotenberg, a developer-friendly API for converting numerous document formats into PDF files, and more!

3685.2M19](/packages/gotenberg-gotenberg-php)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[danielboendergaard/phantom-pdf

A Package for generating PDF files using PhantomJS

72467.9k](/packages/danielboendergaard-phantom-pdf)

PHPackages © 2026

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