PHPackages                             manoj11patel/easy-pdf-for-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. manoj11patel/easy-pdf-for-laravel

ActiveLibrary

manoj11patel/easy-pdf-for-laravel
=================================

TCPDF library for Laravel for all the latest versions

14PHP

Since Aug 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/manoj11patel/easy-pdf-for-laravel)[ Packagist](https://packagist.org/packages/manoj11patel/easy-pdf-for-laravel)[ RSS](/packages/manoj11patel-easy-pdf-for-laravel/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel 6-7-8 TCPDF
===================

[](#laravel-6-7-8-tcpdf)

[![Latest Stable Version](https://camo.githubusercontent.com/f57d315aa139b94408eaa30c74aef1b178e20d65829c256883db61a3de876490/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a3131706174656c2f656173792d7064662d666f722d6c61726176656c2f762f737461626c65)](https://packagist.org/packages/manoj11patel/easy-pdf-for-laravel) [![Total Downloads](https://camo.githubusercontent.com/26af517390573ff7ff3779230d1682150045e14f9cb0ca3252873c6d0e2b747b/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a3131706174656c2f656173792d7064662d666f722d6c61726176656c2f646f776e6c6f616473)](https://packagist.org/packages/manoj11patel/easy-pdf-for-laravel) [![Latest Unstable Version](https://camo.githubusercontent.com/ee3118c4fdc8968d9792100e21d6fe7925258d62ecdbeef06f14f8cd9f3607b0/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a3131706174656c2f656173792d7064662d666f722d6c61726176656c2f762f756e737461626c65)](https://packagist.org/packages/manoj11patel/easy-pdf-for-laravel) [![License](https://camo.githubusercontent.com/9a5067084800098e54923e42182aceac4751e2244b8327c990689cc729749eba/68747470733a2f2f706f7365722e707567782e6f72672f6d616e6f6a3131706174656c2f656173792d7064662d666f722d6c61726176656c2f6c6963656e7365)](https://packagist.org/packages/manoj11patel/easy-pdf-for-laravel)

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

#### 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 `manoj11patel/easy-pdf-for-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)

```
composer require manoj11patel/easy-pdf-for-laravel

```

or

Laravel 5.5+ will use the auto-discovery function.

```
{
    "require": {
        "manoj11patel/easy-pdf-for-laravel": "^8.0"
    }
}
```

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

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

//...

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

(Please note: TCPDF cannot be used as an alias)

for lumen you should add the following lines:

```
$app->register(Manoj\TCPDF\ServiceProvider::class);
class_alias(Manoj\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 --provider="Manoj\TCPDF\ServiceProvider"

```

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

- use\_original\_header is to used the original `Header()` from TCPDF.
    - Please note that `PDF::setHeaderCallback(function($pdf){})` overrides this settings.
- use\_original\_footer is to used the original `Footer()` from TCPDF.
    - Please note that `PDF::setFooterCallback(function($pdf){})` overrides this settings.
- use\_fpdi is so that our internal helper will extend `TcpdfFpdi` instead of `TCPDF`.
    - Please note fpdi is not a dependency in my project so you will have to follow their install instructions [here](https://github.com/Setasign/FPDI)

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

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/25d0b115abf327d66057166796726a5dcc02487064721935182f6892f32bbddc?d=identicon)[manojp](/maintainers/manojp)

---

Top Contributors

[![manoj11patel](https://avatars.githubusercontent.com/u/10825669?v=4)](https://github.com/manoj11patel "manoj11patel (3 commits)")

### Embed Badge

![Health badge](/badges/manoj11patel-easy-pdf-for-laravel/health.svg)

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

PHPackages © 2026

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