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

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

maxxscho/laravel-tcpdf
======================

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

0.2.6(11y ago)8725.7k↓14.3%22[1 PRs](https://github.com/maxxscho/laravel-tcpdf/pulls)MITPHPPHP &gt;=5.3.0

Since Dec 16Pushed 3y ago4 watchersCompare

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

READMEChangelogDependencies (2)Versions (9)Used By (0)

**NOT MAINTAINED ANYMORE!!**

Laravel TCPDF
=============

[](#laravel-tcpdf)

[![Build Status](https://camo.githubusercontent.com/d9c89d1c02a083ad9980eb7dd84f20eb7dfd4365e3758751187e6b27bf2c8ff7/68747470733a2f2f7472617669732d63692e6f72672f6d6178787363686f2f6c61726176656c2d74637064662e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/maxxscho/laravel-tcpdf)

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

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

[](#installation)

The Laravel TCPDF service provider can be installed via [composer](http://getcomposer.org) by requiring the `maxxscho/laravel-tcpdf` 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)

```
{
    "require": {
        "maxxscho/laravel-tcpdf": "0.*"
    }
}
```

Next, add the service provider to `app/config/app.php`.

```
'providers' => [
    //..
    'Maxxscho\LaravelTcpdf\LaravelTcpdfServiceProvider',
]
```

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

Here is a little example:

```
PDF::SetTitle('Hello World');

PDF::AddPage();

PDF::Write(0, 'Hello World');

PDF::Output('hello_world.pdf');
```

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 config:publish maxxscho/laravel-tcpdf

```

Now access `app/config/packages/maxxscho/laravel-tcpdf/config.php`to customize.

Assets
------

[](#assets)

There is a 'blank' image in the assets folder of the package, which is in certain circumstances needed by TCPDF. Publish the assets, like so:

```
php artisan asset:publish maxxscho/laravel-tcpdf

```

Extend/Overwrite
----------------

[](#extendoverwrite)

Extending or overwriting Laravel TCPDF is easy. Simply extend `\Maxxscho\LaravelTcpdf\LaravelTcpdf` with your own class.

Custom Fonts
------------

[](#custom-fonts)

To add custom fonts set the fonts\_directory in the config, relative to the public path. For example `'fonts/'`.

To use a custom font you have to convert a font for TCPDF. Copy your custom font(s) to your fonts path, in our case `public/fonts/`. In your terminal do this:

```
vendor/maxxscho/laravel-tcpdf/vendor/tecnick.com/tcpdf/tools/tcpdf_addfont.php -i public/fonts/yourfont.ttf -o public/fonts

```

This uses a little tool provided by TCPDF to convert fonts for TCPDF. The `-i` flag is for the input fonts (comma-separated list) and the `-o` flag is for the output directory. Read here all about [TCPDF fonts](http://www.tcpdf.org/fonts.php) and how to convert them [the new way](http://queirozf.com/entries/adding-a-custom-font-to-tcpdf).

Custom Header
-------------

[](#custom-header)

"`PDF::setHtmlHeader($custom_header); PDF::Header();`"

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity41

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~59 days

Total

8

Last Release

4173d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/040a740740add6e8239db8508e31459bc299b43bb46636b3e3efa8311473aa7d?d=identicon)[maxxscho](/maintainers/maxxscho)

---

Top Contributors

[![maxxscho](https://avatars.githubusercontent.com/u/543690?v=4)](https://github.com/maxxscho "maxxscho (6 commits)")[![brandonzylstra](https://avatars.githubusercontent.com/u/9854?v=4)](https://github.com/brandonzylstra "brandonzylstra (3 commits)")[![johnvic](https://avatars.githubusercontent.com/u/3714206?v=4)](https://github.com/johnvic "johnvic (3 commits)")[![snipe](https://avatars.githubusercontent.com/u/197404?v=4)](https://github.com/snipe "snipe (1 commits)")

---

Tags

laravelpdfTCPDF

### Embed Badge

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

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

###  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)[elibyy/tcpdf-laravel

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

3542.7M5](/packages/elibyy-tcpdf-laravel)[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)
