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

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

apphostbd/laravel-fpdf
======================

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

v2.0.0(4y ago)42523MITPHPPHP ^7.4 || ^8.0 || ^8.1

Since Oct 20Pushed 3y agoCompare

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

READMEChangelogDependencies (1)Versions (7)Used By (0)

laravel-fpdf
============

[](#laravel-fpdf)

 [ ![tag](https://camo.githubusercontent.com/c1d07bef9fdead91c815f7f879b8db3b4802b7c200fe2cb3213b5ce8c11d984c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f617070686f737462642f6c61726176656c2d66706466) ](https://github.com/apphostbd/laravel-fpdf/tags) [ ![Total Downloads](https://camo.githubusercontent.com/9bb6a3aa5f31ab112af1547982799ccae4fbc1b2321453c1fe169d85a829cd3a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617070686f737462642f6c61726176656c2d66706466) ](https://packagist.org/packages/apphostbd/laravel-fpdf) [ ![Issues](https://camo.githubusercontent.com/412852b72298c79823d7c4b8cfadbc5558bfdae476b6198394c1f62de78db4d7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f617070686f737462642f6c61726176656c2d66706466) ](https://github.com/apphostbd/laravel-fpdf/issues) [ ![Forks](https://camo.githubusercontent.com/d14537ca5292f4bd39c5539148fb9672c7524b5fabeab3c03572ece1d0c63d69/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f617070686f737462642f6c61726176656c2d66706466) ](https://github.com/apphostbd/laravel-fpdf/fork) [ ![Stars](https://camo.githubusercontent.com/219511abbbebff83da4876ae66b4befe9de67e35ff2812a559bba2c69110e166/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f617070686f737462642f6c61726176656c2d66706466) ](https://github.com/apphostbd/laravel-fpdf/stargazers) [ ![](https://camo.githubusercontent.com/bcd1550f8bce062f267e9242a538d43c76105ae422a175bf8226a417206e8b0e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f617070686f737462642f6c61726176656c2d66706466) ](https://github.com/apphostbd/laravel-fpdf/blob/master/LICENSE)

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs..

Installation Composer
---------------------

[](#installation-composer)

```
  composer require apphostbd/laravel-fpdf
```

### Laravel &gt;= 5.5

[](#laravel--55)

Enjoy the auto discovery feature.

### Laravel &lt;5.5

[](#laravel-55)

`config/app.php`

```
// config/app.php

return [
    'aliases' => [
        'Fpdf' => AppHostBD\Fpdf\Facades\FpdfFacade::class,
     ]
```

Basic Tutorial
--------------

[](#basic-tutorial)

### Route Page example

[](#route-page-example)

```
     Route::get('/', function () {
         Fpdf::AddPage();
         Fpdf::SetFont('Courier', 'B', 18);
         Fpdf::Cell(50, 25, 'Hello World!');
         Fpdf::Output();
         exit();
     });
```

### Controller Page example

[](#controller-page-example)

```
namespace App\Http\Controllers;

use Fpdf;

class TestController extends Controller
{
    public function test(){
        Fpdf::AddPage();
        Fpdf::SetFont('Courier', 'B', 18);
        Fpdf::Cell(50, 25, 'Hello World!');
        Fpdf::Output();
        exit;
    }

}

```

### Blade Page example

[](#blade-page-example)

```
namespace App\Http\Controllers;

//use Fpdf;

class TestController extends Controller
{
    public function testView(){
        return view('test');
    }
}
```

Blade Page Path: view/test.blade.php

```
// test.blade.php
