PHPackages                             tjgazel/laravel-fpdf - 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. tjgazel/laravel-fpdf

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

tjgazel/laravel-fpdf
====================

Extension lib FPDF for laravel 5.\*

v1.1.2(5y ago)02.2kMITPHPPHP &gt;=5.4.0

Since Jun 11Pushed 5y ago1 watchersCompare

[ Source](https://github.com/tjgazel/laravel-fpdf)[ Packagist](https://packagist.org/packages/tjgazel/laravel-fpdf)[ Docs](https://github.com/tjgazel/laravel-fpdf)[ RSS](/packages/tjgazel-laravel-fpdf/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

Laravel FPDF
============

[](#laravel-fpdf)

install
-------

[](#install)

**1) Composer**

```
composer require tjgazel/laravel-fpdf
```

**2) Optional:** Laravel 5.4 and below

Add `TJGazel\Toastr\ToastrServiceProvider::class` to `providers` in `config/app.php`.
Add `'Toastr' => TJGazel\Toastr\Facades\Toastr::class` to `aliases` in `config/app.php`.

```
// config/app.php

'providers' => [
  // ...
  TJGazel\LaraFpdf\LaraFpdfServiceProvider::class,
],

'aliases' => [
  // ...
  'LaraFpdf' => TGazel\LaraFpdf\Facades\LaraFpdf::class,
],

```

Usage
-----

[](#usage)

### (Method 1) Facade

[](#method-1-facade)

```
use App\Http\Controllers\Controller;
use TGazel\LaraFpdf\Facades\LaraFpdf;

class MyController extends Controller
{
    public function index()
    {
        LaraFpdf::AddPage();
        LaraFpdf::SetFont('Courier', 'B', 18);
        LaraFpdf::Cell(50, 25, 'Hello World!');
        LaraFpdf::Output('I', "MyPdf.pdf", true);

        exit;
    }
}
```

### (Method 2) Extends class

[](#method-2-extends-class)

create your pdf class

```
namespace App\Pdf;

use TJGazel\LaraFpdf\LaraFpdf;

class MyPdf extends LaraFpdf
{
    private $data

    public function __construct($data)
    {
        $this->data = $data;
        parent::__construct('P', 'mm', 'A4');
        $this->SetA4();
        $this->SetTitle('My pdf title', true);
        $this->SetAuthor('TJGazel', true);
        $this->AddPage('L');
        $this->Body();
    }

    public function Header()
    {
        // fixed all pages
    }

    public function Body()
    {
        $this->SetFont('Arial', 'B', '24');
        $this->Cell(50, 25, $this->data->title);

        $this->SetFont('Arial', '', '14');
        $this->Cell(50, 25, $this->data->content);
    }

    public function Footer()
    {
        // fixed all pages
    }
}
```

In your controll

```
use App\Http\Controllers\Controller;
use App\Pdf\MyPdf;

class MyController extends Controller
{
    public function index()
    {
        $data = MyModel::all();

        $myPdf = new MyPdf($data);

        $myPdf->Output('I', "MyPdf.pdf", true);

        exit;
    }
}
```

FPDF oficial docs
=================

[](#fpdf-oficial-docs)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~226 days

Total

4

Last Release

1902d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/16039710?v=4)[Talles Gazel](/maintainers/tjgazel)[@tjgazel](https://github.com/tjgazel)

---

Top Contributors

[![tjgazel](https://avatars.githubusercontent.com/u/16039710?v=4)](https://github.com/tjgazel "tjgazel (16 commits)")

---

Tags

laravelpdffpdf

### Embed Badge

![Health badge](/badges/tjgazel-laravel-fpdf/health.svg)

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

###  Alternatives

[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.4k99.4M385](/packages/barryvdh-laravel-dompdf)[lucasromanojf/laravel5-pdf

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

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

PHPackages © 2026

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