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

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

igormatkovic/pdf
================

dompdf for Laravel 4

1.0.5(12y ago)122MITPHPPHP &gt;=5.3.0

Since Jun 22Pushed 11y ago1 watchersCompare

[ Source](https://github.com/igormatkovic/pdf-l4)[ Packagist](https://packagist.org/packages/igormatkovic/pdf)[ RSS](/packages/igormatkovic-pdf/feed)WikiDiscussions master Synced 6d ago

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

Dompdf
======

[](#dompdf)

Simple Dompdf package for Laravel 4 This package uses the latest stable version (0.5)

[![Build Status](https://camo.githubusercontent.com/20091b015ae1483e91a75cdfda769eaf2a62c189098a427074b9df6ed2116e03/68747470733a2f2f7472617669732d63692e6f72672f7468756a6f686e2f7064662d6c342e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/thujohn/pdf-l4)

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

[](#installation)

Add `thujohn/pdf` to `composer.json`.

```
"thujohn/pdf": "dev-master"

```

Run `composer update` to pull down the latest version of Pdf.

Now open up `app/config/app.php` and add the service provider to your `providers` array.

```
'providers' => array(
	'Thujohn\Pdf\PdfServiceProvider',
)
```

Now add the alias.

```
'aliases' => array(
	'PDF' => 'Thujohn\Pdf\PdfFacade',
)
```

Publish the config

```
php artisan config:publish thujohn/pdf

```

Usage
-----

[](#usage)

Show a PDF

```
Route::get('/', function()
{
	$html = ''
			. 'Put your html here, or generate it with your favourite '
			. 'templating system.'
			. '';
	return PDF::load($html, 'A4', 'portrait')->show();
});
```

Download a PDF

```
Route::get('/', function()
{
	$html = ''
			. 'Put your html here, or generate it with your favourite '
			. 'templating system.'
			. '';
	return PDF::load($html, 'A4', 'portrait')->download('my_pdf');
});
```

Returns a PDF as a string

```
Route::get('/', function()
{
	$html = ''
			. 'Put your html here, or generate it with your favourite '
			. 'templating system.'
			. '';
	$pdf = PDF::load($html, 'A4', 'portrait')->output();
});
```

Multiple PDFs

```
for ($i=1;$iload(View::make('pdf.image'))->output();
	File::put(public_path('test'.$i.'.pdf'), $content);
}
PDF::clear();
```

Examples
--------

[](#examples)

Save the PDF to a file in a specific folder, and then mail it as attachement. By @w0rldart

```
define('BUDGETS_DIR', public_path('uploads/budgets')); // I define this in a constants.php file

if (!is_dir(BUDGETS_DIR)){
	mkdir(BUDGETS_DIR, 0755, true);
}

$outputName = str_random(10); // str_random is a [Laravel helper](http://laravel.com/docs/helpers#strings)
$pdfPath = BUDGETS_DIR.'/'.$outputName.'.pdf';
File::put($pdfPath, PDF::load($view, 'A4', 'portrait')->output());

Mail::send('emails.pdf', $data, function($message) use ($pdfPath){
	$message->from('us@example.com', 'Laravel');
	$message->to('you@example.com');
	$message->attach($pdfPath);
});
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 77.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 ~28 days

Total

6

Last Release

4567d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/65602f365138878980125607ea33928261d4a9069b4a4ab57bc261e09d81090d?d=identicon)[igormatkovic](/maintainers/igormatkovic)

---

Top Contributors

[![thujohn](https://avatars.githubusercontent.com/u/580699?v=4)](https://github.com/thujohn "thujohn (24 commits)")[![igormatkovic](https://avatars.githubusercontent.com/u/2323435?v=4)](https://github.com/igormatkovic "igormatkovic (2 commits)")[![chakphanu](https://avatars.githubusercontent.com/u/2822342?v=4)](https://github.com/chakphanu "chakphanu (1 commits)")[![KennedyTedesco](https://avatars.githubusercontent.com/u/999232?v=4)](https://github.com/KennedyTedesco "KennedyTedesco (1 commits)")[![w0rldart](https://avatars.githubusercontent.com/u/673081?v=4)](https://github.com/w0rldart "w0rldart (1 commits)")[![juukie](https://avatars.githubusercontent.com/u/2678657?v=4)](https://github.com/juukie "juukie (1 commits)")[![hardevine](https://avatars.githubusercontent.com/u/1171618?v=4)](https://github.com/hardevine "hardevine (1 commits)")

---

Tags

laravelpdfdompdflaravel4

### Embed Badge

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

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

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

PHPackages © 2026

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