Package Data | |
---|---|
Maintainer Username: | beverio |
Package Create Date: | 2016-11-11 |
Package Last Update: | 2016-11-11 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-12-26 15:22:42 |
Package Statistics | |
---|---|
Total Downloads: | 296 |
Monthly Downloads: | 0 |
Daily Downloads: | 0 |
Total Stars: | 1 |
Total Watchers: | 1 |
Total Forks: | 2 |
Total Open Issues: | 0 |
Forked from: elibyy/tcpdf-laravel
Require package using
composer require beverio/tcpdf-laravel
Add the service provider and aliases to config/app.php
.
'providers' => [
//...
Elibyy\TCPDF\ServiceProvider::class,
]
//...
'aliases' => [
//...
'PDF' => Elibyy\TCPDF\Facades\TCPDF::class
]
Create a view in resources/views/
. You can use all TCPDF methods with the PDF
facade.
Close each view with
PDF::Show();
In your controller use
return PDF::inline('path.to.view', compact('var1', 'var2'), 'OptionalFilename.pdf');
to show a PDF file inline, or
return PDF::save('path.to.view', compact('var1', 'var2'), 'OptionalFilename.pdf');
to force the user to download the file.
For a list of all available function take a look at the TCPDF Documentation
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 config/tcpdf.php
to customize.