PHPackages                             siturra/tcpdf-laravel - 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. siturra/tcpdf-laravel

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

siturra/tcpdf-laravel
=====================

tcpdf support for laravel 5

5.5.3(8y ago)17.3k↓75%1MITPHP

Since Feb 10Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (40)Used By (0)

Laravel 5.6 TCPDF
=================

[](#laravel-56-tcpdf)

[![Latest Stable Version](https://camo.githubusercontent.com/fc462d69c7fa88e7dddd5ad59c94a3dc98bcb7ace0bb7e60f27506074934bf55/68747470733a2f2f706f7365722e707567782e6f72672f656c696279792f74637064662d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/elibyy/tcpdf-laravel) [![Total Downloads](https://camo.githubusercontent.com/12c54a16065e65f90a7f3e8d9aab3dfe923b2b6e39adedbe6fdf6e3afd3385ff/68747470733a2f2f706f7365722e707567782e6f72672f656c696279792f74637064662d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/elibyy/tcpdf-laravel) [![Latest Unstable Version](https://camo.githubusercontent.com/68e7fc05be5794d0c6e859cfae7433dad3d7c72133fbf66617682e7f6e02496a/68747470733a2f2f706f7365722e707567782e6f72672f656c696279792f74637064662d6c61726176656c2f762f756e737461626c65)](https://packagist.org/packages/elibyy/tcpdf-laravel) [![License](https://camo.githubusercontent.com/81042a95e7d62f3f394f567a5d8d9b24da6953167162a13f8ef8f0b82214763a/68747470733a2f2f706f7365722e707567782e6f72672f656c696279792f74637064662d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/elibyy/tcpdf-laravel)

A simple [Laravel 5](http://www.laravel.com) service provider with some basic configuration for including the [TCPDF library](http://www.tcpdf.org/)

### Note: The Package code is changed to avoid the confusion, this repository is a replacement to the [old](https://github.com/elibyy/laravel-tcpdf) one

[](#note-the-package-code-is-changed-to-avoid-the-confusion-this-repository-is-a-replacement-to-the--old-one)

#### Note: The versions are now as laravel 5.x

[](#note-the-versions-are-now-as-laravel-5x)

#### TCPDF is not really supported in PHP 7 but there's a plan for supporting it, check [this](https://github.com/tecnickcom/tc-lib-pdf) out.

[](#tcpdf-is-not-really-supported-in-php-7-but-theres-a-plan-for-supporting-it-check-this-out)

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

[](#installation)

The Laravel TCPDF service provider can be installed via [composer](http://getcomposer.org) by requiring the `elibyy/tcpdf-laravel` package in your project's `composer.json`. (The installation may take a while, because the package requires TCPDF. Sadly its .git folder is very heavy)

Laravel 5.5+ will use the auto-discovery function.

```
{
    "require": {
        "elibyy/tcpdf-laravel": "5.6.*"
    }
}
```

If you don't use auto-discovery you will need to include the service provider / facade in `config/app.php`.

```
'providers' => [
    //...
    Elibyy\TCPDF\ServiceProvider::class,
]

//...

'aliases' => [
	//...
	'PDF' => Elibyy\TCPDF\Facades\TCPDF::class
]
```

for lumen you should add the following lines:

```
$app->register(Elibyy\TCPDF\ServiceProvider::class);
class_alias(Elibyy\TCPDF\Facades\TCPDF::class, 'PDF');
```

That's it! You're good to go.

Here is a little example:

```
use PDF; // at the top of the file

	PDF::SetTitle('Hello World');
	PDF::AddPage();
	PDF::Write(0, 'Hello World');
	PDF::Output('hello_world.pdf');
```

another example for generating multiple PDF's

```
use PDF; // at the top of the file
	for ($i = 0; $i < 5; $i++) {
		PDF::SetTitle('Hello World'.$i);
		PDF::AddPage();
		PDF::Write(0, 'Hello World'.$i);
		PDF::Output(public_path('hello_world' . $i . '.pdf'), 'F');
		PDF::reset();
	}
```

For a list of all available function take a look at the [TCPDF Documentation](http://www.tcpdf.org/doc/code/classTCPDF.html)

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

[](#configuration)

Laravel-TCPDF comes with some basic configuration. If you want to override the defaults, you can publish the config, like so:

```
php artisan vendor:publish

```

Now access `config/tcpdf.php` to customize.

Header/Footer helpers
---------------------

[](#headerfooter-helpers)

I've got a pull-request asking for this so I've added the feature

now you can use `PDF::setHeaderCallback(function($pdf){})` or `PDF::setFooterCallback(function($pdf){})`

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 79.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 ~21 days

Total

37

Last Release

2997d ago

### Community

Maintainers

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

---

Top Contributors

[![elibyy](https://avatars.githubusercontent.com/u/836551?v=4)](https://github.com/elibyy "elibyy (27 commits)")[![it-can](https://avatars.githubusercontent.com/u/644288?v=4)](https://github.com/it-can "it-can (6 commits)")[![sebaiturravaldes](https://avatars.githubusercontent.com/u/11622941?v=4)](https://github.com/sebaiturravaldes "sebaiturravaldes (1 commits)")

---

Tags

laravelpdfTCPDF

### Embed Badge

![Health badge](/badges/siturra-tcpdf-laravel/health.svg)

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

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

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

3542.7M5](/packages/elibyy-tcpdf-laravel)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[maxxscho/laravel-tcpdf

A simple Laravel 4 service provider with some basic configuration for including the TCPDF library

8725.7k](/packages/maxxscho-laravel-tcpdf)[tarfin-labs/easy-pdf

Makes pdf processing easy.

1718.3k](/packages/tarfin-labs-easy-pdf)[lucasromanojf/laravel5-pdf

Provides the HTML2PDF functionality using the wkhtmltopdf library (Laravel 5)

1271.8k](/packages/lucasromanojf-laravel5-pdf)

PHPackages © 2026

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