PHPackages                             artisan/laravel-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. artisan/laravel-pdf

Abandoned → [humans/laravel-pdf](/?search=humans%2Flaravel-pdf)Library[PDF &amp; Document Generation](/categories/documents)

artisan/laravel-pdf
===================

0.1.5(6y ago)012MITPHP

Since Jan 22Pushed 6y ago2 watchersCompare

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

READMEChangelogDependencies (1)Versions (7)Used By (0)

Laravel PDF
===========

[](#laravel-pdf)

Laravel PDF is a factory for different PDF packages. Here are the drivers supported as of now:

- Log
- Laravel Snappy
- Compose (To be released)

Installation and Usage
----------------------

[](#installation-and-usage)

```
composer require artisan/laravel-pdf

```

This uses package discovery, but if you've disabled package discovery, make sure to add the provider to your `config/app.php`.

```
'providers' => [
    Artisan\Pdf\PdfServiceProvider::class,
],
```

### Log Driver

[](#log-driver)

The log driver passes in all of the execution commands to the log files with the parameters necessary to render the document.

This is a pretty good stand in if you'd rather not mock your commands for this or you're working offline.

### Snappy Driver

[](#snappy-driver)

To use the Snappy driver, the `barryvdh/laravel-snappy` package is required.

```
composer require barryvdh/laravel-snappy
```

### Compose Driver

[](#compose-driver)

Compose is an API for building PDFs so projects don't really need any overhead for setting it all up.

To use the Compose driver, the `symfony/http-client` package is required.

```
composer require symfony/http-client
```

Extending the driver
--------------------

[](#extending-the-driver)

```
Pdf::extend('customdriver', function ($app) {
  return new CustomerDriver;
});
```

Mocking
-------

[](#mocking)

To mock this in your testing, you can use the facade helpers, or use mockery in your tests.

### Facades

[](#facades)

```
use Artisan\Pdf\Pdf;

Pdf::shouldReceive('html->stream')->once()->andReturn('Some content for the PDF.');
```

### Mockery

[](#mockery)

```
use Artisan\Pdf\Manager as PdfManager;
use Artisan\Pdf\Pdf;

$pdf = Mockery::mock(PdfManager::class);
$pdf->shouldReceive('html->stream')->once()->andReturn('Some content for the PDF.');

$this->instance(Pdf::class, $pdf);
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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 ~0 days

Total

6

Last Release

2300d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9a52a3c800262e4c030c9b67498ecfc18288d0258e3a2469c87bfddcb94691be?d=identicon)[artisan](/maintainers/artisan)

### Embed Badge

![Health badge](/badges/artisan-laravel-pdf/health.svg)

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

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M711](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

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

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[rap2hpoutre/fast-excel

Fast Excel import/export for Laravel

2.3k24.9M47](/packages/rap2hpoutre-fast-excel)[elibyy/tcpdf-laravel

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

3542.7M5](/packages/elibyy-tcpdf-laravel)[stevebauman/autodoc-facades

Auto-generate PHP doc annotations for Laravel facades

98186.6k9](/packages/stevebauman-autodoc-facades)

PHPackages © 2026

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