Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codedge/laravel-fpdf
Create PDFs with Laravel, provides FPDF version 1.86
https://github.com/codedge/laravel-fpdf
fpdf laravel laravel-fpdf laravel-package pdf-generation
Last synced: 16 days ago
JSON representation
Create PDFs with Laravel, provides FPDF version 1.86
- Host: GitHub
- URL: https://github.com/codedge/laravel-fpdf
- Owner: codedge
- License: mit
- Created: 2016-05-23T18:01:10.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-05-15T10:18:41.000Z (6 months ago)
- Last Synced: 2024-05-16T00:40:37.641Z (6 months ago)
- Topics: fpdf, laravel, laravel-fpdf, laravel-package, pdf-generation
- Language: PHP
- Homepage:
- Size: 406 KB
- Stars: 258
- Watchers: 7
- Forks: 77
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Laravel package for Fpdf
[![Latest Stable Version](https://poser.pugx.org/codedge/laravel-fpdf/v/stable?format=flat-square)](https://packagist.org/packages/codedge/laravel-fpdf)
[![Total Downloads](https://poser.pugx.org/codedge/laravel-fpdf/downloads?format=flat-square)](https://packagist.org/packages/codedge/laravel-fpdf)
[![](https://github.com/codedge/laravel-fpdf/workflows/Tests/badge.svg)](https://github.com/codedge/laravel-fpdf/actions)
[![StyleCI](https://styleci.io/repos/59506451/shield)](https://styleci.io/repos/59506451)
[![License](https://poser.pugx.org/codedge/laravel-fpdf/license?format=flat-square)](https://packagist.org/packages/codedge/laravel-fpdf)Using [FPDF](http://www.fpdf.org/) made easy with Laravel. See [FPDF homepage](http://www.fpdf.org/) for more information about the usage.
## Installation using [Composer](https://getcomposer.org/)
```sh
composer require codedge/laravel-fpdf
```## Configuration
Run
`php artisan vendor:publish --provider="Codedge\Fpdf\FpdfServiceProvider" --tag=config`
to publish the configuration file to `config/fpdf.php`.## Usage
```php
// app/Http/routes.php | app/routes/web.phpRoute::get('/', function (Codedge\Fpdf\Fpdf\Fpdf $fpdf) {
$fpdf->AddPage();
$fpdf->SetFont('Courier', 'B', 18);
$fpdf->Cell(50, 25, 'Hello World!');
$fpdf->Output();
exit;});
```### Defining fonts
FPDF comes with a set of fonts already defined and stored in the `src/Fpdf/font` directory.
If you want to add your own font, please have a look at the [Adding new fonts and encodings](http://www.fpdf.org/en/tutorial/tuto7.htm) tutorial.You can change the font path, by using the `FPDF_FONTPATH` environment variable.
## Use in Laravel Vapor
If you want to use [Laravel Vapor](https://vapor.laravel.com) to host your application,
[a special header](https://docs.vapor.build/1.0/projects/development.html#binary-responses) needs to be attached to each response that FPDF returns to your browser.
To enable the use of this header, add the following environment variable to the Vapor environment file:```dotenv
FPDF_VAPOR_HEADERS=true
```