Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tony98ms/fpdf-laravel
Paquete para generar PDF usando la Liberia FPDF de PHP
https://github.com/tony98ms/fpdf-laravel
Last synced: 5 days ago
JSON representation
Paquete para generar PDF usando la Liberia FPDF de PHP
- Host: GitHub
- URL: https://github.com/tony98ms/fpdf-laravel
- Owner: tony98ms
- License: mit
- Created: 2021-08-16T22:33:16.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-08-24T04:22:08.000Z (over 3 years ago)
- Last Synced: 2024-11-21T19:53:04.762Z (about 1 month ago)
- Language: PHP
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Laravel package for Fpdf
[![Latest Stable Version](https://poser.pugx.org/tonystore/fpdf-laravel/v/stable?format=flat-square)](https://packagist.org/packages/tonystore/fpdf-laravel)
[![Total Downloads](https://poser.pugx.org/tonystore/fpdf-laravel/downloads?format=flat-square)](https://packagist.org/packages/tonystore/fpdf-laravel)
[![License](https://poser.pugx.org/tonystore/fpdf-laravel/license?format=flat-square)](https://packagist.org/packages/tonystore/fpdf-laravel)This package uses [FPDF](http://www.fpdf.org/) and allows integration with [Laravel](https://laravel.com/), and is based on the [crabbly/fpdf-laravel](https://github.com/crabbly/fpdf-laravel) package, but with an updated version of [FPDF](http://www.fpdf.org/).
## INSTALLATION VIA COMPOSER
### Step 1: Composer
Run this command line in console.
```sh
composer require tonystore/fpdf-laravel
```
### Step 2: Service ProviderFor your Laravel app, open `config/app.php` and, within the `providers` array, append:
```
Tonystore\Fpdf\FpdfServiceProvider::class
```## Usage
We can resolve the FPDF class instance out of the container:
```
$pdf = app('Fpdf');```
OR
```
$pdf = new Fpdf();```
## Example
Create a 'Hello World' PDF document and display it in the browser:
```php
use Illuminate\Support\Facades\Storage;//create pdf document
$pdf = new Fpdf('P', 'mm', 'A4'); //Attributes assigned to the document.
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output(); // 'I' is the default output.
exit;```