tonystore / fpdf-laravel
Paquete para usar Libreria FPDF en Laravel
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: ^7.2.5|^8.0
Requires (Dev)
- phpunit/phpunit: ~5.0
This package is auto-updated.
Last update: 2024-10-24 11:30:11 UTC
README
This package uses FPDF and allows integration with Laravel, and is based on the crabbly/fpdf-laravel package, but with an updated version of FPDF.
INSTALLATION VIA COMPOSER
Step 1: Composer
Run this command line in console.
composer require tonystore/fpdf-laravel
Step 2: Service Provider
For 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:
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;