2017 © Pedro Peláez
 

library tcpdf-laravel

tcpdf support for laravel 5

image

siturra/tcpdf-laravel

tcpdf support for laravel 5

  • Monday, March 5, 2018
  • by siturra
  • Repository
  • 1 Watchers
  • 0 Stars
  • 51 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 19 Forks
  • 0 Open issues
  • 42 Versions
  • 629 % Grown

The README.md

Laravel 5.6 TCPDF

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

A simple Laravel 5 service provider with some basic configuration for including the TCPDF library, (*2)

Note: The Package code is changed to avoid the confusion, this repository is a replacement to the old one

Note: The versions are now as laravel 5.x

TCPDF is not really supported in PHP 7 but there's a plan for supporting it, check this out.

Installation

The Laravel TCPDF service provider can be installed via composer by requiring the elibyy/tcpdf-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), (*3)

Laravel 5.5+ will use the auto-discovery function., (*4)

{
    "require": {
        "elibyy/tcpdf-laravel": "5.6.*"
    }
}

If you don't use auto-discovery you will need to include the service provider / facade in config/app.php., (*5)

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

//...

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

for lumen you should add the following lines:, (*6)

$app->register(Elibyy\TCPDF\ServiceProvider::class);
class_alias(Elibyy\TCPDF\Facades\TCPDF::class, 'PDF');

That's it! You're good to go., (*7)

Here is a little example:, (*8)

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, (*9)

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, (*10)

Configuration

Laravel-TCPDF comes with some basic configuration. If you want to override the defaults, you can publish the config, like so:, (*11)

php artisan vendor:publish

Now access config/tcpdf.php to customize., (*12)

I've got a pull-request asking for this so I've added the feature, (*13)

now you can use PDF::setHeaderCallback(function($pdf){}) or PDF::setFooterCallback(function($pdf){}), (*14)

The Versions

05/03 2018

dev-master

9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

05/03 2018

5.5.x-dev

5.5.9999999.9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

05/03 2018

5.5.3

5.5.3.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

01/03 2018

dev-patch-2

dev-patch-2

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

01/03 2018

dev-patch-1

dev-patch-1

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

19/02 2018

5.6.x-dev

5.6.9999999.9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.4.x-dev

5.4.9999999.9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.3.x-dev

5.3.9999999.9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.3.4

5.3.4.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.2.x-dev

5.2.9999999.9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.2.6

5.2.6.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.1.x-dev

5.1.9999999.9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.1.6

5.1.6.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.0.x-dev

5.0.9999999.9999999-dev

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

28/12 2017

5.0.5

5.0.5.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

17/12 2017

5.5.2

5.5.2.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

17/12 2017

5.4.3

5.4.3.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

17/12 2017

5.3.3

5.3.3.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

17/12 2017

5.2.5

5.2.5.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

17/12 2017

5.0.4

5.0.4.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

17/12 2017

5.1.5

5.1.5.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

03/09 2017

5.5.1

5.5.1.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

31/08 2017

5.5.0

5.5.0.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

03/07 2017

5.4.2

5.4.2.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

09/05 2017

5.4.1

5.4.1.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

09/05 2017

5.3.1

5.3.1.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

09/05 2017

5.2.4

5.2.4.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

09/05 2017

5.1.4

5.1.4.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

25/01 2017

5.4.0

5.4.0.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

24/08 2016

5.3.0

5.3.0.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

19/04 2016

5.2.3

5.2.3.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

19/04 2016

5.1.3

5.1.3.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

19/04 2016

5.0.3

5.0.3.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

08/03 2016

5.0.2

5.0.2.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

08/03 2016

5.1.2

5.1.2.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

08/03 2016

5.2.2

5.2.2.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

08/03 2016

5.2.1

5.2.1.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

08/03 2016

5.1.1

5.1.1.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

08/03 2016

5.0.1

5.0.1.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

10/02 2016

5.2.0

5.2.0.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

10/02 2016

5.1.0

5.1.0.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf

10/02 2016

5.0.0

5.0.0.0

tcpdf support for laravel 5

  Sources   Download

MIT

The Requires

 

by eli y

laravel pdf tcpdf