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

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

xaoc/laravel-tcpdf
==================

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

0.2.6(11y ago)316.0k3MITPHPPHP &gt;=5.3.0

Since Dec 16Pushed 8y ago1 watchersCompare

[ Source](https://github.com/xAockd/laravel-tcpdf)[ Packagist](https://packagist.org/packages/xaoc/laravel-tcpdf)[ RSS](/packages/xaoc-laravel-tcpdf/feed)WikiDiscussions master Synced today

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

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

[](#laravel-tcpdf)

[![Build Status](https://camo.githubusercontent.com/05c505e6faff232ba16f5a18243328f5546b361162cfb249ba9063d581c894e8/68747470733a2f2f7472617669732d63692e6f72672f78416f636b642f6c61726176656c2d74637064662e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/xAockd/laravel-tcpdf)

A simple [Laravel 5](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 `xaoc/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": {
        "xaoc/laravel-tcpdf": "dev-master"
    }
}
```

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

```
'providers' => [
    //..
    'Xaoc\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 vendor:publish

```

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

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

[](#extendoverwrite)

Extending or overwriting Laravel TCPDF is easy. Simply extend `\Xaoc\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/xaoc/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).

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity29

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 59.1% 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 ~51 days

Recently: every ~59 days

Total

8

Last Release

4227d ago

### Community

Maintainers

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

---

Top Contributors

[![xAockd](https://avatars.githubusercontent.com/u/3390348?v=4)](https://github.com/xAockd "xAockd (13 commits)")[![brandonzylstra](https://avatars.githubusercontent.com/u/9854?v=4)](https://github.com/brandonzylstra "brandonzylstra (3 commits)")[![koss-shtukert](https://avatars.githubusercontent.com/u/709096?v=4)](https://github.com/koss-shtukert "koss-shtukert (3 commits)")[![maxxscho](https://avatars.githubusercontent.com/u/543690?v=4)](https://github.com/maxxscho "maxxscho (3 commits)")

---

Tags

laravelpdfTCPDF

### Embed Badge

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

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

###  Alternatives

[elibyy/tcpdf-laravel

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

3632.9M8](/packages/elibyy-tcpdf-laravel)[maxxscho/laravel-tcpdf

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

8725.8k](/packages/maxxscho-laravel-tcpdf)[rockett/weasyprint

A feature-rich WeasyPrint wrapper for generating PDFs from HTML and CSS, with support for PDF/A, PDF/UA, attachments, and optional Laravel integration.

30224.7k](/packages/rockett-weasyprint)[tarfin-labs/easy-pdf

Makes pdf processing easy.

1719.9k](/packages/tarfin-labs-easy-pdf)

PHPackages © 2026

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